1# Copyright (C) 2013 The Android Open Source Project 2# 3# Redistribution and use in source and binary forms, with or without 4# modification, are permitted provided that the following conditions are 5# met: 6# 7# * Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# * Redistributions in binary form must reproduce the above 10# copyright notice, this list of conditions and the following disclaimer 11# in the documentation and/or other materials provided with the 12# distribution. 13# * Neither the name of Google Inc. nor the names of its 14# contributors may be used to endorse or promote products derived from 15# this software without specific prior written permission. 16# 17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 29LOCAL_PATH := $(call my-dir)/googletest 30 31# Common definitions 32 33googletest_includes := $(LOCAL_PATH)/include 34 35googletest_sources := \ 36 src/gtest-death-test.cc \ 37 src/gtest-filepath.cc \ 38 src/gtest-port.cc \ 39 src/gtest-printers.cc \ 40 src/gtest-test-part.cc \ 41 src/gtest-typed-test.cc \ 42 src/gtest.cc 43 44googletest_main_sources := \ 45 src/gtest_main.cc 46 47# GoogleTest library modules. 48 49include $(CLEAR_VARS) 50LOCAL_MODULE := googletest_static 51LOCAL_SRC_FILES := $(googletest_sources) 52LOCAL_C_INCLUDES := $(googletest_includes) 53LOCAL_EXPORT_C_INCLUDES := $(googletest_includes) 54include $(BUILD_STATIC_LIBRARY) 55 56include $(CLEAR_VARS) 57LOCAL_MODULE := googletest_shared 58LOCAL_SRC_FILES := $(googletest_sources) 59LOCAL_C_INCLUDES := $(googletest_includes) 60LOCAL_CFLAGS := -DGTEST_CREATE_SHARED_LIBRARY 61LOCAL_EXPORT_C_INCLUDES := $(googletest_includes) 62include $(BUILD_SHARED_LIBRARY) 63 64# GoogleTest 'main' helper modules. 65 66include $(CLEAR_VARS) 67LOCAL_MODULE := googletest_main 68LOCAL_SRC_FILES := $(googletest_main_sources) 69LOCAL_STATIC_LIBRARIES := googletest_static 70include $(BUILD_STATIC_LIBRARY) 71 72include $(CLEAR_VARS) 73LOCAL_MODULE := googletest_main_shared 74LOCAL_SRC_FILES := $(googletest_main_sources) 75LOCAL_SHARED_LIBRARIES := googletest_shared 76include $(BUILD_STATIC_LIBRARY) 77 78# The GoogleTest test programs. 79# 80 81# The unit test suite itself. 82# This excludes tests that require a Python wrapper to run properly. 83# Note that this is _very_ slow to compile :) 84include $(CLEAR_VARS) 85LOCAL_MODULE := googletest_unittest 86 87# IMPORTANT: The test looks at the name of its executable and expects 88# the following. Otherwise OutputFileHelpersTest.GetCurrentExecutableName 89# will FAIL. 90# 91LOCAL_MODULE_FILENAME := gtest_all_test 92LOCAL_SRC_FILES := \ 93 test/gtest-filepath_test.cc \ 94 test/gtest-linked_ptr_test.cc \ 95 test/gtest-message_test.cc \ 96 test/gtest-options_test.cc \ 97 test/gtest-port_test.cc \ 98 test/gtest_pred_impl_unittest.cc \ 99 test/gtest_prod_test.cc \ 100 test/gtest-test-part_test.cc \ 101 test/gtest-typed-test_test.cc \ 102 test/gtest-typed-test2_test.cc \ 103 test/gtest_unittest.cc \ 104 test/production.cc 105LOCAL_STATIC_LIBRARIES := googletest_main 106include $(BUILD_EXECUTABLE) 107 108# The GoogleTest samples. 109# These are much quicker to build and run. 110 111include $(CLEAR_VARS) 112LOCAL_MODULE := googletest_sample_1 113LOCAL_SRC_FILES := \ 114 samples/sample1.cc \ 115 samples/sample1_unittest.cc 116LOCAL_STATIC_LIBRARIES := googletest_main_shared 117include $(BUILD_EXECUTABLE) 118 119include $(CLEAR_VARS) 120LOCAL_MODULE := googletest_sample_2 121LOCAL_SRC_FILES := \ 122 samples/sample2.cc \ 123 samples/sample2_unittest.cc 124LOCAL_STATIC_LIBRARIES := googletest_main_shared 125include $(BUILD_EXECUTABLE) 126 127include $(CLEAR_VARS) 128LOCAL_MODULE := googletest_sample_3 129LOCAL_SRC_FILES := \ 130 samples/sample3_unittest.cc 131LOCAL_STATIC_LIBRARIES := googletest_main_shared 132include $(BUILD_EXECUTABLE) 133 134include $(CLEAR_VARS) 135LOCAL_MODULE := googletest_sample_4 136LOCAL_SRC_FILES := \ 137 samples/sample4.cc \ 138 samples/sample4_unittest.cc 139LOCAL_STATIC_LIBRARIES := googletest_main_shared 140include $(BUILD_EXECUTABLE) 141 142include $(CLEAR_VARS) 143LOCAL_MODULE := googletest_sample_5 144LOCAL_SRC_FILES := \ 145 samples/sample1.cc \ 146 samples/sample5_unittest.cc 147LOCAL_STATIC_LIBRARIES := googletest_main_shared 148include $(BUILD_EXECUTABLE) 149 150include $(CLEAR_VARS) 151LOCAL_MODULE := googletest_sample_6 152LOCAL_SRC_FILES := \ 153 samples/sample6_unittest.cc 154LOCAL_STATIC_LIBRARIES := googletest_main_shared 155include $(BUILD_EXECUTABLE) 156 157include $(CLEAR_VARS) 158LOCAL_MODULE := googletest_sample_7 159LOCAL_SRC_FILES := \ 160 samples/sample7_unittest.cc 161LOCAL_STATIC_LIBRARIES := googletest_main_shared 162include $(BUILD_EXECUTABLE) 163 164include $(CLEAR_VARS) 165LOCAL_MODULE := googletest_sample_8 166LOCAL_SRC_FILES := \ 167 samples/sample8_unittest.cc 168LOCAL_STATIC_LIBRARIES := googletest_main_shared 169include $(BUILD_EXECUTABLE) 170 171include $(CLEAR_VARS) 172LOCAL_MODULE := googletest_sample_9 173LOCAL_SRC_FILES := \ 174 samples/sample9_unittest.cc 175LOCAL_STATIC_LIBRARIES := googletest_main_shared 176include $(BUILD_EXECUTABLE) 177