Home | History | Annotate | Download | only in src
      1 # Copyright (C) 2009 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 #
     15 #
     16 
     17 # Gtest builds 2 libraries: libgtest and libgtest_main. libgtest
     18 # contains most of the code (assertions...) and libgtest_main just
     19 # provide a common main to run the test (ie if you link against
     20 # libgtest_main you won't/should not provide a main() entry point.
     21 #
     22 # We build these 2 libraries for the target device and for the host if
     23 # it is running linux and using ASTL.
     24 #
     25 
     26 # TODO: The targets below have some redundancy. Check if we cannot
     27 # condense them using function(s) for the common code.
     28 
     29 LOCAL_PATH := $(call my-dir)
     30 
     31 libgtest_target_includes := \
     32     bionic/libstdc++/include \
     33     external/stlport/stlport \
     34     $(LOCAL_PATH)/.. \
     35     $(LOCAL_PATH)/../include
     36 
     37 libgtest_host_includes := \
     38   $(LOCAL_PATH)/.. \
     39   $(LOCAL_PATH)/../include
     40 
     41 #######################################################################
     42 # gtest lib host
     43 
     44 include $(CLEAR_VARS)
     45 
     46 LOCAL_CPP_EXTENSION := .cc
     47 
     48 LOCAL_SRC_FILES := gtest-all.cc
     49 
     50 LOCAL_C_INCLUDES := $(libgtest_host_includes)
     51 
     52 LOCAL_CFLAGS += -O0
     53 
     54 LOCAL_MODULE := libgtest_host
     55 
     56 include $(BUILD_HOST_STATIC_LIBRARY)
     57 
     58 #######################################################################
     59 # gtest_main lib host
     60 
     61 include $(CLEAR_VARS)
     62 
     63 LOCAL_CPP_EXTENSION := .cc
     64 
     65 LOCAL_SRC_FILES := gtest_main.cc
     66 
     67 LOCAL_C_INCLUDES := $(libgtest_host_includes)
     68 
     69 LOCAL_CFLAGS += -O0
     70 
     71 LOCAL_MODULE := libgtest_main_host
     72 
     73 include $(BUILD_HOST_STATIC_LIBRARY)
     74 
     75 #######################################################################
     76 # gtest lib target
     77 
     78 include $(CLEAR_VARS)
     79 
     80 LOCAL_CPP_EXTENSION := .cc
     81 
     82 LOCAL_SRC_FILES := gtest-all.cc
     83 
     84 LOCAL_C_INCLUDES := $(libgtest_target_includes)
     85 
     86 ifneq ($(BUILD_WITH_ASTL),true)
     87 include external/stlport/libstlport.mk
     88 endif
     89 
     90 LOCAL_MODULE := libgtest
     91 
     92 include $(BUILD_STATIC_LIBRARY)
     93 
     94 #######################################################################
     95 # gtest_main lib target
     96 
     97 include $(CLEAR_VARS)
     98 
     99 LOCAL_CPP_EXTENSION := .cc
    100 
    101 LOCAL_SRC_FILES := gtest_main.cc
    102 
    103 LOCAL_C_INCLUDES := $(libgtest_target_includes)
    104 
    105 ifneq ($(BUILD_WITH_ASTL),true)
    106 include external/stlport/libstlport.mk
    107 endif
    108 
    109 LOCAL_MODULE := libgtest_main
    110 
    111 include $(BUILD_STATIC_LIBRARY)
    112