blob: 782b7cb2a52b9c7250068591eba24603cacda94e [file] [log] [blame]
Dan Albert2ef012e2014-04-08 12:03:21 -07001#
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
17LOCAL_PATH := $(call my-dir)
18
19LIBCXX_SRC_FILES := \
20 src/algorithm.cpp \
21 src/bind.cpp \
22 src/chrono.cpp \
23 src/condition_variable.cpp \
24 src/debug.cpp \
25 src/exception.cpp \
26 src/future.cpp \
27 src/hash.cpp \
28 src/ios.cpp \
29 src/iostream.cpp \
30 src/locale.cpp \
31 src/memory.cpp \
32 src/mutex.cpp \
33 src/new.cpp \
34 src/optional.cpp \
35 src/random.cpp \
36 src/regex.cpp \
37 src/shared_mutex.cpp \
38 src/stdexcept.cpp \
39 src/string.cpp \
40 src/strstream.cpp \
41 src/system_error.cpp \
42 src/thread.cpp \
43 src/typeinfo.cpp \
44 src/utility.cpp \
45 src/valarray.cpp \
Dan Albert2ef012e2014-04-08 12:03:21 -070046
Dan Albert6c2fdb82014-05-16 09:55:15 -070047LIBCXX_C_INCLUDES := \
48 $(LOCAL_PATH)/include/ \
Dan Albert3bfb9442014-06-23 16:32:13 -070049 external/libcxxabi/include \
Dan Albert6c2fdb82014-05-16 09:55:15 -070050
Dan Albert2ef012e2014-04-08 12:03:21 -070051LIBCXX_CPPFLAGS := \
Dan Albert2ef012e2014-04-08 12:03:21 -070052 -std=c++11 \
Dan Albert8a6f7b12014-05-01 17:49:58 -070053 -nostdinc++ \
Dan Albert2ef012e2014-04-08 12:03:21 -070054 -fexceptions \
55
Dan Albert6c2fdb82014-05-16 09:55:15 -070056# target static lib
Dan Albert2ef012e2014-04-08 12:03:21 -070057include $(CLEAR_VARS)
58LOCAL_MODULE := libc++
59LOCAL_CLANG := true
60LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
Dan Albert3bfb9442014-06-23 16:32:13 -070061LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES)
62LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS)
Dan Albertf1550542014-05-06 14:16:05 -070063LOCAL_RTTI_FLAG := -frtti
Dan Albert3bfb9442014-06-23 16:32:13 -070064LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi libcompiler_rt
Dan Albert6c2fdb82014-05-16 09:55:15 -070065LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
66include $(BUILD_STATIC_LIBRARY)
67
68# target dynamic lib
69include $(CLEAR_VARS)
70LOCAL_MODULE := libc++
71LOCAL_CLANG := true
72LOCAL_WHOLE_STATIC_LIBRARIES := libc++
Dan Albert9569f042014-05-01 18:12:37 -070073LOCAL_SHARED_LIBRARIES := libdl
Dan Albert32ec1ea2014-05-23 18:44:06 -070074LOCAL_SYSTEM_SHARED_LIBRARIES := libc libm
Dan Albert226cd952014-04-16 10:58:40 -070075
Dan Albertc10e7192014-04-16 16:38:42 -070076ifneq ($(TARGET_ARCH),arm)
Dan Albert226cd952014-04-16 10:58:40 -070077 LOCAL_SHARED_LIBRARIES += libdl
78endif
79
Brian Carlstrom12c28912014-05-09 20:47:13 -070080LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albert2ef012e2014-04-08 12:03:21 -070081include $(BUILD_SHARED_LIBRARY)
82
Dan Albert6c2fdb82014-05-16 09:55:15 -070083# host static lib
Dan Albert2ef012e2014-04-08 12:03:21 -070084include $(CLEAR_VARS)
85LOCAL_MODULE := libc++
86LOCAL_CLANG := true
87LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
Dan Albert6c2fdb82014-05-16 09:55:15 -070088LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES)
Dan Albert2ef012e2014-04-08 12:03:21 -070089LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS)
Dan Albertf1550542014-05-06 14:16:05 -070090LOCAL_RTTI_FLAG := -frtti
Dan Albert3bfb9442014-06-23 16:32:13 -070091LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi
Ian Rogersada29642014-06-05 11:09:44 -070092LOCAL_MULTILIB := both
Tim Murrayd513b7a2014-04-21 15:06:30 -070093
Dan Albert3bfb9442014-06-23 16:32:13 -070094ifneq ($(HOST_OS), darwin)
95LOCAL_WHOLE_STATIC_LIBRARIES += libcompiler_rt
Dan Albert6c2fdb82014-05-16 09:55:15 -070096endif
Dan Albert3bfb9442014-06-23 16:32:13 -070097
Dan Albert6c2fdb82014-05-16 09:55:15 -070098LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
99include $(BUILD_HOST_STATIC_LIBRARY)
100
Ying Wangb1300bd2014-08-01 14:17:08 -0700101# Don't build for unbundled branches
102ifeq (,$(TARGET_BUILD_APPS))
103
Dan Albert6c2fdb82014-05-16 09:55:15 -0700104# host dynamic lib
105include $(CLEAR_VARS)
106LOCAL_MODULE := libc++
107LOCAL_CLANG := true
108LOCAL_LDFLAGS := -nodefaultlibs
109LOCAL_LDLIBS := -lc
110LOCAL_WHOLE_STATIC_LIBRARIES := libc++
Ian Rogersada29642014-06-05 11:09:44 -0700111LOCAL_MULTILIB := both
Dan Albert6c2fdb82014-05-16 09:55:15 -0700112
113ifeq ($(HOST_OS), darwin)
Dan Albert8a6f7b12014-05-01 17:49:58 -0700114LOCAL_LDFLAGS += \
Tim Murrayd513b7a2014-04-21 15:06:30 -0700115 -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \
Tim Murrayd513b7a2014-04-21 15:06:30 -0700116 -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \
117 -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp
118else
Dan Albert7d57f1b2014-05-12 14:54:53 -0700119LOCAL_LDLIBS += -lrt -lpthread -ldl -lm
Tim Murrayd513b7a2014-04-21 15:06:30 -0700120endif
121
Brian Carlstrom12c28912014-05-09 20:47:13 -0700122LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albert2ef012e2014-04-08 12:03:21 -0700123include $(BUILD_HOST_SHARED_LIBRARY)
Stephen Hines27ae7cb2014-04-25 19:13:02 -0700124
125endif # TARGET_BUILD_APPS