Export libc++abi headers for musl sysroot am: ae7de2c7ea am: a315f25cb4 am: 3322981460
Original change: https://android-review.googlesource.com/c/platform/external/libcxxabi/+/2000834
Change-Id: Ib408025946a16142288a7f31eaab30b03b72a48f
diff --git a/Android.bp b/Android.bp
index 8d298ab..13951ff 100644
--- a/Android.bp
+++ b/Android.bp
@@ -176,3 +176,30 @@
"src/cxa_demangle.cpp",
],
}
+
+// Export libc++abi headers for inclusion in the musl sysroot.
+genrule {
+ name: "libc_musl_sysroot_libc++abi_headers",
+ visibility: ["//external/musl"],
+ srcs: [
+ "NOTICE",
+ "include/**/*",
+ ],
+ out: ["libc_musl_sysroot_libc++abi_headers.zip"],
+ tools: [
+ "soong_zip",
+ "zip2zip",
+ ],
+ cmd: "LIBCXXABI_DIR=$$(dirname $(location NOTICE)) && " +
+ "$(location soong_zip) -o $(genDir)/sysroot.zip -symlinks=false" +
+ // NOTICE
+ " -j -f $(location NOTICE) " +
+ // headers
+ " -P include/c++ " +
+ " -C $${LIBCXXABI_DIR}/include " +
+ " -D $${LIBCXXABI_DIR}/include " +
+ " && " +
+ "$(location zip2zip) -i $(genDir)/sysroot.zip -o $(out) " +
+ " include/**/*:include " +
+ " NOTICE:NOTICE.libc++abi",
+}