Permalink
Browse files

Build libc++ as static dependency

Libc++ barely has usuable packages outside of AOSP. Requiring users
to download them has proven to be impossible. Static include libc++

Thanks to Dees Troy (TWRP) for the help tracking this build system
down to enforce a static dependency on libc++
  • Loading branch information...
iBotPeaches committed Oct 10, 2015
1 parent 0e562ca commit ef9e8d86d0941cb80097f05274ec76fbdef2fbe7
Showing with 18 additions and 0 deletions.
  1. +18 −0 tools/aapt/Android.mk
View
@@ -102,6 +102,22 @@ LOCAL_SRC_FILES := $(aaptSources)
include $(BUILD_HOST_STATIC_LIBRARY)
+# ==========================================================
+# Build the host static library: libc++
+# ==========================================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libc++
+LOCAL_CFLAGS += -Wno-format-y2k -DSTATIC_ANDROIDFW_FOR_TOOLS $(aaptCFlags)
+LOCAL_CPPFLAGS += $(aaptCppFlags)
+ifeq (darwin,$(HOST_OS))
+LOCAL_CFLAGS += -D_DARWIN_UNLIMITED_STREAMS
+endif
+LOCAL_C_INCLUDES += $(aaptCIncludes)
+LOCAL_SRC_FILES := $(aaptSources)
+
+include $(BUILD_HOST_STATIC_LIBRARY)
+
# ==========================================================
# Build the host executable: aapt
# ==========================================================
@@ -113,6 +129,8 @@ LOCAL_CPPFLAGS += $(aaptCppFlags)
LOCAL_LDLIBS += $(aaptHostLdLibs)
LOCAL_SRC_FILES := $(aaptMain)
LOCAL_STATIC_LIBRARIES += libaapt $(aaptHostStaticLibs)
+LOCAL_WHOLE_STATIC_LIBRARIES := libc++
+LOCAL_CXX_STL := libc++_static
include $(BUILD_HOST_EXECUTABLE)

0 comments on commit ef9e8d8

Please sign in to comment.