blob: 68050770dac7bb925fc93ff20bd71a55df7103a1 [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
Stephen Hines27ae7cb2014-04-25 19:13:02 -070017# Don't build for unbundled branches
18ifeq (,$(TARGET_BUILD_APPS))
19
Dan Albert1a42fce2014-04-16 16:29:36 -070020# libcxx isn't working on mips yet
21ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH), mips mips64))
Dan Albert2ef012e2014-04-08 12:03:21 -070022LOCAL_PATH := $(call my-dir)
23
24LIBCXX_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
53LIBCXX_CPPFLAGS := \
54 -I$(LOCAL_PATH)/include/ \
55 -Iexternal/libcxxabi/include \
56 -std=c++11 \
57 -nostdlib \
58 -fexceptions \
59
60include $(CLEAR_VARS)
61LOCAL_MODULE := libc++
62LOCAL_CLANG := true
63LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
64LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS)
65LOCAL_SYSTEM_SHARED_LIBRARIES := libc
66LOCAL_SHARED_LIBRARIES := libcxxabi
Dan Albert226cd952014-04-16 10:58:40 -070067
Dan Albertc10e7192014-04-16 16:38:42 -070068ifneq ($(TARGET_ARCH),arm)
Dan Albert226cd952014-04-16 10:58:40 -070069 LOCAL_SHARED_LIBRARIES += libdl
70endif
71
Dan Albert2ef012e2014-04-08 12:03:21 -070072include $(BUILD_SHARED_LIBRARY)
73
74include $(CLEAR_VARS)
75LOCAL_MODULE := libc++
76LOCAL_CLANG := true
77LOCAL_SRC_FILES := $(LIBCXX_SRC_FILES)
78LOCAL_CPPFLAGS := $(LIBCXX_CPPFLAGS)
Tim Murrayd513b7a2014-04-21 15:06:30 -070079
80ifeq ($(HOST_OS), darwin)
81LOCAL_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
86else
87LOCAL_LDFLAGS := -lrt -lpthread
88endif
89
Dan Albert2ef012e2014-04-08 12:03:21 -070090LOCAL_SHARED_LIBRARIES := libcxxabi
91include $(BUILD_HOST_SHARED_LIBRARY)
Dan Albert1a42fce2014-04-16 16:29:36 -070092endif
Stephen Hines27ae7cb2014-04-25 19:13:02 -070093
94endif # TARGET_BUILD_APPS