Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 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 | |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 17 | # Don't build for unbundled branches |
| 18 | ifeq (,$(TARGET_BUILD_APPS)) |
| 19 | |
Dan Albert | 1a42fce | 2014-04-16 16:29:36 -0700 | [diff] [blame] | 20 | # libcxx isn't working on mips yet |
| 21 | ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH), mips mips64)) |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 22 | LOCAL_PATH := $(call my-dir) |
| 23 | |
| 24 | LIBCXX_SRC_FILES := \ |
| 25 | src/algorithm.cpp \ |
| 26 | src/bind.cpp \ |
| 27 | src/chrono.cpp \ |
| 28 | src/condition_variable.cpp \ |
| 29 | src/debug.cpp \ |
| 30 | src/exception.cpp \ |
| 31 | src/future.cpp \ |
| 32 | src/hash.cpp \ |
| 33 | src/ios.cpp \ |
| 34 | src/iostream.cpp \ |
| 35 | src/locale.cpp \ |
| 36 | src/memory.cpp \ |
| 37 | src/mutex.cpp \ |
| 38 | src/new.cpp \ |
| 39 | src/optional.cpp \ |
| 40 | src/random.cpp \ |
| 41 | src/regex.cpp \ |
| 42 | src/shared_mutex.cpp \ |
| 43 | src/stdexcept.cpp \ |
| 44 | src/string.cpp \ |
| 45 | src/strstream.cpp \ |
| 46 | src/system_error.cpp \ |
| 47 | src/thread.cpp \ |
| 48 | src/typeinfo.cpp \ |
| 49 | src/utility.cpp \ |
| 50 | src/valarray.cpp \ |
| 51 | src/stubs.cpp \ |
| 52 | |
| 53 | LIBCXX_CPPFLAGS := \ |
| 54 | -I$(LOCAL_PATH)/include/ \ |
| 55 | -Iexternal/libcxxabi/include \ |
| 56 | -std=c++11 \ |
| 57 | -nostdlib \ |
| 58 | -fexceptions \ |
| 59 | |
| 60 | include $(CLEAR_VARS) |
| 61 | LOCAL_MODULE := libc++ |
| 62 | LOCAL_CLANG := true |
| 63 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
| 64 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
| 65 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc |
| 66 | LOCAL_SHARED_LIBRARIES := libcxxabi |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 67 | |
Dan Albert | c10e719 | 2014-04-16 16:38:42 -0700 | [diff] [blame] | 68 | ifneq ($(TARGET_ARCH),arm) |
Dan Albert | 226cd95 | 2014-04-16 10:58:40 -0700 | [diff] [blame] | 69 | LOCAL_SHARED_LIBRARIES += libdl |
| 70 | endif |
| 71 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 72 | include $(BUILD_SHARED_LIBRARY) |
| 73 | |
| 74 | include $(CLEAR_VARS) |
| 75 | LOCAL_MODULE := libc++ |
| 76 | LOCAL_CLANG := true |
| 77 | LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES) |
| 78 | LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS) |
Tim Murray | d513b7a | 2014-04-21 15:06:30 -0700 | [diff] [blame] | 79 | |
| 80 | ifeq ($(HOST_OS), darwin) |
| 81 | LOCAL_LDFLAGS := \ |
| 82 | -Wl,-unexported_symbols_list,external/libcxx/lib/libc++unexp.exp \ |
| 83 | -Wl,-reexported_symbols_list,external/libcxx/lib/libc++abi2.exp \ |
| 84 | -Wl,-force_symbols_not_weak_list,external/libcxx/lib/notweak.exp \ |
| 85 | -Wl,-force_symbols_weak_list,external/libcxx/lib/weak.exp |
| 86 | else |
| 87 | LOCAL_LDFLAGS := -lrt -lpthread |
| 88 | endif |
| 89 | |
Dan Albert | 2ef012e | 2014-04-08 12:03:21 -0700 | [diff] [blame] | 90 | LOCAL_SHARED_LIBRARIES := libcxxabi |
| 91 | include $(BUILD_HOST_SHARED_LIBRARY) |
Dan Albert | 1a42fce | 2014-04-16 16:29:36 -0700 | [diff] [blame] | 92 | endif |
Stephen Hines | 27ae7cb | 2014-04-25 19:13:02 -0700 | [diff] [blame] | 93 | |
| 94 | endif # TARGET_BUILD_APPS |