From 69ab970c6946798c04e4bf4bbd2311e08a69051f Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 1 Mar 2016 17:50:19 -0800 Subject: Add build files. The gtest Android.mk is a little unusal. We use this source exactly in both the platform and the NDK, but the module definitions needs to be slightly different for each. We don't ship gmock in the NDK (yet), so it is spared this mess. Test: make checkbuild && adb sync && ./run_tests.py Bug: http://b/16574165 Change-Id: I4f4224ab05b59acb3118ce1629ad998d0c5fe1b9 --- googletest/Android.bp | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 googletest/Android.bp (limited to 'googletest/Android.bp') diff --git a/googletest/Android.bp b/googletest/Android.bp new file mode 100644 index 00000000..308b6dc9 --- /dev/null +++ b/googletest/Android.bp @@ -0,0 +1,142 @@ +// Copyright (C) 2016 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. + +cc_defaults { + name: "libgtest_defaults", + local_include_dirs: [ + "include", + ], + export_include_dirs: [ + "include", + ], + target: { + android: { + product_variables: { + unbundled_build: { + // Don't build for unbundled branches + enabled: false, + }, + }, + }, + }, +} + +cc_defaults { + name: "libgtest_host_defaults", + target: { + windows: { + enabled: true, + }, + }, +} + +// NDK libraries. +// We need to build one pair of (libgtest, libgtest_main) for each of the three +// STLs we support in the NDK since the user's app might use any of them. + +// stlport +cc_library_static { + name: "libgtest_ndk_stlport", + defaults: ["libgtest_defaults"], + sdk_version: "9", + stl: "stlport_static", + srcs: ["src/gtest-all.cc"], +} + +cc_library_static { + name: "libgtest_main_ndk_stlport", + defaults: ["libgtest_defaults"], + sdk_version: "9", + stl: "stlport_static", + srcs: ["src/gtest_main.cc"], +} + +// libc++ +cc_library_static { + name: "libgtest_ndk_c++", + defaults: ["libgtest_defaults"], + sdk_version: "9", + stl: "c++_static", + srcs: ["src/gtest-all.cc"], +} + +cc_library_static { + name: "libgtest_main_ndk_c++", + defaults: ["libgtest_defaults"], + sdk_version: "9", + stl: "c++_static", + srcs: ["src/gtest_main.cc"], +} + +// gnustl +cc_library_static { + name: "libgtest_ndk_gnustl", + defaults: ["libgtest_defaults"], + sdk_version: "9", + stl: "gnustl_static", + srcs: ["src/gtest-all.cc"], +} + +cc_library_static { + name: "libgtest_main_ndk_gnustl", + defaults: ["libgtest_defaults"], + sdk_version: "9", + stl: "gnustl_static", + srcs: ["src/gtest_main.cc"], +} + +// Platform and host libraries. +cc_library_static { + name: "libgtest", + defaults: ["libgtest_defaults", "libgtest_host_defaults"], + host_supported: true, + srcs: ["src/gtest-all.cc"], + sanitize: { + never: true, + }, + rtti: true, +} + +cc_library_static { + name: "libgtest_main", + defaults: ["libgtest_defaults", "libgtest_host_defaults"], + host_supported: true, + clang: true, + srcs: ["src/gtest_main.cc"], + sanitize: { + never: true, + }, +} + +// Legacy libraries for makefiles that refer to libgtest_host +cc_library_host_static { + name: "libgtest_host", + whole_static_libs: ["libgtest"], + defaults: ["libgtest_host_defaults"], +} + +cc_library_host_static { + name: "libgtest_main_host", + whole_static_libs: ["libgtest_main"], + defaults: ["libgtest_host_defaults"], +} + +cc_library { + name: "libgtest_prod", + defaults: ["libgtest_defaults", "libgtest_host_defaults"], + host_supported: true, + export_include_dirs: ["include"], +} + +// Tests are in the Android.mk. Run with external/googletest/run_tests.py. -- cgit v1.2.3