blob: 7e287363962809d9eca53207e7a5141ba77a30cd [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 := \
Dan Albert4b1aaf92015-08-12 13:21:00 -070020 src/algorithm.cpp \
21 src/any.cpp \
22 src/bind.cpp \
23 src/chrono.cpp \
24 src/condition_variable.cpp \
Dan Albert4b1aaf92015-08-12 13:21:00 -070025 src/debug.cpp \
26 src/exception.cpp \
27 src/future.cpp \
28 src/hash.cpp \
29 src/ios.cpp \
30 src/iostream.cpp \
31 src/locale.cpp \
32 src/memory.cpp \
33 src/mutex.cpp \
34 src/new.cpp \
35 src/optional.cpp \
36 src/random.cpp \
37 src/regex.cpp \
38 src/shared_mutex.cpp \
39 src/stdexcept.cpp \
40 src/string.cpp \
41 src/strstream.cpp \
Dan Albert4b1aaf92015-08-12 13:21:00 -070042 src/system_error.cpp \
43 src/thread.cpp \
44 src/typeinfo.cpp \
45 src/utility.cpp \
46 src/valarray.cpp \
Dan Albert2ef012e2014-04-08 12:03:21 -070047
Dan Albert6c2fdb82014-05-16 09:55:15 -070048LIBCXX_C_INCLUDES := \
Dan Albert4b1aaf92015-08-12 13:21:00 -070049 $(LOCAL_PATH)/include/ \
Dan Albert6c2fdb82014-05-16 09:55:15 -070050
Dan Albert2ef012e2014-04-08 12:03:21 -070051LIBCXX_CPPFLAGS := \
Dan Albert4b1aaf92015-08-12 13:21:00 -070052 -std=c++14 \
53 -nostdinc++ \
54 -fexceptions \
Dan Austin1418e412016-05-24 16:24:42 -070055 -DLIBCXX_BUILDING_LIBCXXABI \
Dan Albert2ef012e2014-04-08 12:03:21 -070056
Dan Albert6c2fdb82014-05-16 09:55:15 -070057# target static lib
Dan Albert2ef012e2014-04-08 12:03:21 -070058include $(CLEAR_VARS)
Dan Albertb82dd132014-09-26 15:43:43 -070059LOCAL_MODULE := libc++_static
Dan Albert2ef012e2014-04-08 12:03:21 -070060LOCAL_CLANG := true
61LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
Dan Albert3bfb9442014-06-23 16:32:13 -070062LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES)
Dan Albert0ad34df2015-09-24 16:29:07 -070063LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include
Dan Albert3bfb9442014-06-23 16:32:13 -070064LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS)
Dan Albertf1550542014-05-06 14:16:05 -070065LOCAL_RTTI_FLAG := -frtti
Dan Albert8d0c51f2015-04-01 15:19:05 -070066LOCAL_WHOLE_STATIC_LIBRARIES := libc++abi
Dan Albertc4ecec12014-09-15 12:54:16 -070067LOCAL_CXX_STL := none
Dan Albert6c2fdb82014-05-16 09:55:15 -070068include $(BUILD_STATIC_LIBRARY)
69
70# target dynamic lib
71include $(CLEAR_VARS)
72LOCAL_MODULE := libc++
73LOCAL_CLANG := true
Dan Albert60295172015-09-24 14:04:08 -070074LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include
Dan Albertb82dd132014-09-26 15:43:43 -070075LOCAL_WHOLE_STATIC_LIBRARIES := libc++_static
Dan Albert9569f042014-05-01 18:12:37 -070076LOCAL_SHARED_LIBRARIES := libdl
Dan Albertc4ecec12014-09-15 12:54:16 -070077LOCAL_CXX_STL := none
Dan Albert2cfc4792015-03-31 16:33:55 -070078LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
Dan Albert2ea63372015-06-23 13:34:02 -070079LOCAL_LDFLAGS_arm := -Wl,--exclude-libs,libunwind_llvm.a
Dan Albert2ef012e2014-04-08 12:03:21 -070080include $(BUILD_SHARED_LIBRARY)
81
Dan Albert6c2fdb82014-05-16 09:55:15 -070082# host static lib
Dan Albert2ef012e2014-04-08 12:03:21 -070083include $(CLEAR_VARS)
Dan Albertb82dd132014-09-26 15:43:43 -070084LOCAL_MODULE := libc++_static
Dan Albert2ef012e2014-04-08 12:03:21 -070085LOCAL_CLANG := true
86LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
Dan Albert6c2fdb82014-05-16 09:55:15 -070087LOCAL_C_INCLUDES := $(LIBCXX_C_INCLUDES)
Dan Albert0ad34df2015-09-24 16:29:07 -070088LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include
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
Dan Albertc4ecec12014-09-15 12:54:16 -070093LOCAL_CXX_STL := none
Dan Albert6c2fdb82014-05-16 09:55:15 -070094include $(BUILD_HOST_STATIC_LIBRARY)
95
96# host dynamic lib
97include $(CLEAR_VARS)
98LOCAL_MODULE := libc++
99LOCAL_CLANG := true
Dan Albert60295172015-09-24 14:04:08 -0700100LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include external/libcxxabi/include
Dan Albert6c2fdb82014-05-16 09:55:15 -0700101LOCAL_LDFLAGS := -nodefaultlibs
Dan Albertb82dd132014-09-26 15:43:43 -0700102LOCAL_WHOLE_STATIC_LIBRARIES := libc++_static
Ian Rogersada29642014-06-05 11:09:44 -0700103LOCAL_MULTILIB := both
Dan Albertc4ecec12014-09-15 12:54:16 -0700104LOCAL_CXX_STL := none
Dan Albert6c2fdb82014-05-16 09:55:15 -0700105
106ifeq ($(HOST_OS), darwin)
Dan Albert8a6f7b12014-05-01 17:49:58 -0700107LOCAL_LDFLAGS += \
Tim Murrayd513b7a2014-04-21 15:06:30 -0700108 -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \
Tim Murrayd513b7a2014-04-21 15:06:30 -0700109 -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \
110 -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp
111else
Dan Albert94962fb2015-03-03 15:05:07 -0800112LOCAL_LDLIBS += -lrt -lpthread -ldl
Tim Murrayd513b7a2014-04-21 15:06:30 -0700113endif
114
Dan Albert2ef012e2014-04-08 12:03:21 -0700115include $(BUILD_HOST_SHARED_LIBRARY)
Stephen Hines27ae7cb2014-04-25 19:13:02 -0700116
Dan Albertb4344022015-10-14 14:41:54 -0700117ifdef LIBCXX_TESTING
118include $(LOCAL_PATH)/buildcmds/Android.mk
119endif