aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp38
-rw-r--r--configuration/android/fruit/impl/fruit-config-base.h72
2 files changed, 110 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..9907842
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,38 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Simply '#include <fruit/fruit.h>' to get started.
+// See https://github.com/google/fruit/wiki for more details.
+cc_library {
+ name: "libfruit",
+ host_supported: true,
+ export_include_dirs: ["include", "configuration/android"],
+ srcs: ["src/**/*.cpp", ],
+}
+
+// TODO: tests written in python+pytest that calls back into compiler. unclear how to best proceed.
+
+cc_defaults {
+ name: "libfruit-example-defaults",
+ host_supported: true,
+ gtest: false,
+ shared_libs: ["libfruit"],
+ cflags: ["-Wno-non-virtual-dtor"],
+}
+
+cc_test {
+ defaults: ["libfruit-example-defaults"],
+ name: "libfruit-example-hello-world",
+ srcs: ["examples/hello_world/**/*.cpp"],
+}
diff --git a/configuration/android/fruit/impl/fruit-config-base.h b/configuration/android/fruit/impl/fruit-config-base.h
new file mode 100644
index 0000000..678f7dd
--- /dev/null
+++ b/configuration/android/fruit/impl/fruit-config-base.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2014 Google Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef FRUIT_CONFIG_BASE_H
+#define FRUIT_CONFIG_BASE_H
+
+// Needed for all Clang versions (as of January 2016), not needed for GCC.
+// This can also be defined for GCC, but it slightly slows down compile time of code using Fruit.
+#define FRUIT_HAS_CLANG_ARBITRARY_OVERLOAD_RESOLUTION_BUG 1
+
+// Whether the compiler defines std::max_align_t.
+#define FRUIT_HAS_STD_MAX_ALIGN_T 1
+
+// Whether the compiler defines ::max_align_t.
+// Ignored if FRUIT_HAS_STD_MAX_ALIGN_T is set.
+#define FRUIT_HAS_MAX_ALIGN_T 1
+
+// Whether the compiler defines std::is_trivially_copyable.
+#define FRUIT_HAS_STD_IS_TRIVIALLY_COPYABLE 1
+
+// Whether the compiler defines __has_trivial_copy.
+// Ignored if FRUIT_HAS_STD_IS_TRIVIALLY_COPYABLE is set.
+#define FRUIT_HAS_HAS_TRIVIAL_COPY 1
+
+// Whether the compiler defines __is_trivially_copyable.
+// Ignored if FRUIT_HAS_STD_IS_TRIVIALLY_COPYABLE is set.
+#define FRUIT_HAS_IS_TRIVIALLY_COPYABLE 1
+
+// Whether the compiler defines std::is_trivially_copy_constructible.
+#define FRUIT_HAS_STD_IS_TRIVIALLY_COPY_CONSTRUCTIBLE 1
+
+// Whether typeid() is available. Typically, it is unless RTTI is disabled.
+// Android-changed: Android does not use RTTI by default.
+// #define FRUIT_HAS_TYPEID 1
+
+// Whether typeid() is constexpr. Typically, it is except in MSVC.
+#define FRUIT_HAS_CONSTEXPR_TYPEID 1
+
+// Whether abi::__cxa_demangle() is available after including cxxabi.h.
+#define FRUIT_HAS_CXA_DEMANGLE 1
+
+// Android-changed: Android does not have boost library.
+#define FRUIT_USES_BOOST 0
+
+#define FRUIT_HAS_ALWAYS_INLINE_ATTRIBUTE 1
+
+#define FRUIT_HAS_FORCEINLINE 0
+
+#define FRUIT_HAS_ATTRIBUTE_DEPRECATED 0
+
+#define FRUIT_HAS_GCC_ATTRIBUTE_DEPRECATED 1
+
+#define FRUIT_HAS_DECLSPEC_DEPRECATED 0
+
+#define FRUIT_HAS_MSVC_ASSUME 0
+
+#define FRUIT_HAS_BUILTIN_UNREACHABLE 1
+
+#endif // FRUIT_CONFIG_BASE_H