OSDN Git Service

Allow asan for glibc tests.
[android-x86/bionic.git] / tests / Android.build.mk
1 #
2 # Copyright (C) 2014 The Android Open Source Project
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 include $(CLEAR_VARS)
18 LOCAL_ADDITIONAL_DEPENDENCIES := $(common_additional_dependencies)
19
20 LOCAL_MODULE := $(module)
21 LOCAL_MODULE_TAGS := $(module_tag)
22 ifeq ($(build_type),host)
23 # Always make host multilib
24 LOCAL_MULTILIB := both
25 endif
26
27 ifneq ($(findstring LIBRARY, $(build_target)),LIBRARY)
28     LOCAL_MODULE_STEM_32 := $(module)32
29     LOCAL_MODULE_STEM_64 := $(module)64
30 else
31 ifeq ($($(module)_install_to_out_data),true)
32     LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$(module)
33     LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module)
34 endif
35 endif
36
37 LOCAL_CLANG := $($(module)_clang_$(build_type))
38
39 ifneq ($($(module)_allow_asan),true)
40 LOCAL_ADDRESS_SANITIZER := false
41 endif
42
43 LOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable)
44
45 ifneq ($($(module)_multilib),)
46     LOCAL_MULTILIB := $($(module)_multilib)
47 endif
48
49 LOCAL_CFLAGS := \
50     $(common_cflags) \
51     $($(module)_cflags) \
52     $($(module)_cflags_$(build_type)) \
53
54 LOCAL_CONLYFLAGS += \
55     $(common_conlyflags) \
56     $($(module)_conlyflags) \
57     $($(module)_conlyflags_$(build_type)) \
58
59 LOCAL_CPPFLAGS += \
60     $(common_cppflags) \
61     $($(module)_cppflags) \
62     $($(module)_cppflags_$(build_type)) \
63
64 LOCAL_C_INCLUDES := \
65     $(common_c_includes) \
66     $($(module)_c_includes) \
67     $($(module)_c_includes_$(build_type)) \
68
69 LOCAL_SRC_FILES := \
70     $($(module)_src_files) \
71     $($(module)_src_files_$(build_type)) \
72
73 LOCAL_STATIC_LIBRARIES := \
74     $($(module)_static_libraries) \
75     $($(module)_static_libraries_$(build_type)) \
76
77 LOCAL_SHARED_LIBRARIES := \
78     $($(module)_shared_libraries) \
79     $($(module)_shared_libraries_$(build_type)) \
80
81 LOCAL_WHOLE_STATIC_LIBRARIES := \
82     $($(module)_whole_static_libraries) \
83     $($(module)_whole_static_libraries_$(build_type)) \
84
85 LOCAL_LDFLAGS := \
86     $($(module)_ldflags) \
87     $($(module)_ldflags_$(build_type)) \
88
89 LOCAL_LDLIBS := \
90     $($(module)_ldlibs) \
91     $($(module)_ldlibs_$(build_type)) \
92
93 ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
94 LOCAL_CXX_STL := libc++_static
95 else
96 LOCAL_CXX_STL := libc++
97 endif
98
99 ifeq ($(build_type),target)
100   include $(BUILD_$(build_target))
101 endif
102
103 ifeq ($(build_type),host)
104   # Only build if host builds are supported.
105   ifeq ($(build_host),true)
106     include $(BUILD_HOST_$(build_target))
107   endif
108 endif