summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Jansen <jansene@google.com>2023-08-31 15:26:15 -0700
committerErwin Jansen <jansene@google.com>2023-08-31 15:27:48 -0700
commit0fe02a00addad8d2b4c304ddc900f4a03f4d4f68 (patch)
tree5c66ae6f50c314aa2ba6722f1361373cfd4649a5
parenta90b9ba4d6444ceff845d6a3e7a1c95240ec3196 (diff)
downloadglib-0fe02a00addad8d2b4c304ddc900f4a03f4d4f68.tar.gz
Include architecture in library name
We now include the architecture in glib shared library name. This makes sure we can ship multiple versions of the library side by side. This is needed to make sure a netsimd can pick up the x86 library if needed. Bug: 298454492 Change-Id: I79e01e307b1d7cbba398d2d6c0337308f6d5e5a6
-rw-r--r--glib/CMakeLists.txt44
1 files changed, 30 insertions, 14 deletions
diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index c87aa5525..9880fcaaa 100644
--- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt
@@ -1,9 +1,11 @@
# darwin-aarch64 PUBLIC os/darwin/aarch64) android_target_link_libraries( glib2
# darwin-x86_64 PUBLIC "-framework CoreFoundation" "-framework AppKit")
-# Let's add in the library
+# Let's add in the library, we are appending the binary type, as we will ship
+# multiple versions on m1.
+message(STATUS "Building glib2 for ${ANDROID_TARGET_TAG}")
android_add_library(
- TARGET glib2
+ TARGET glib2_${ANDROID_TARGET_TAG}
SHARED
LIBNAME
glib-2.0
@@ -120,7 +122,7 @@ android_add_library(
LINUX gjournal-private.c)
target_compile_options(
- glib2
+ glib2_${ANDROID_TARGET_TAG}
PRIVATE -fvisibility=hidden
-Winvalid-pch
-Wextra
@@ -151,11 +153,12 @@ target_compile_options(
-Wno-string-plus-int)
target_compile_definitions(
- glib2 PRIVATE GLIB_COMPILATION _GNU_SOURCE G_DISABLE_CAST_CHECKS
- GLIB_CHARSETALIAS_DIR="")
+ glib2_${ANDROID_TARGET_TAG}
+ PRIVATE GLIB_COMPILATION _GNU_SOURCE G_DISABLE_CAST_CHECKS
+ GLIB_CHARSETALIAS_DIR="")
android_target_include_directories(
- glib2
+ glib2_${ANDROID_TARGET_TAG}
linux
PUBLIC
../os/linux/glib
@@ -164,18 +167,19 @@ android_target_include_directories(
..)
android_target_include_directories(
- glib2
+ glib2_${ANDROID_TARGET_TAG}
darwin
PUBLIC
../os/darwin/glib
../glib
../os/darwin
..)
-android_target_link_libraries(glib2 darwin PUBLIC "-framework CoreFoundation"
- "-framework AppKit" iconv c)
+android_target_link_libraries(
+ glib2_${ANDROID_TARGET_TAG} darwin PUBLIC "-framework CoreFoundation"
+ "-framework AppKit" iconv c)
android_target_include_directories(
- glib2
+ glib2_${ANDROID_TARGET_TAG}
windows
PUBLIC
../os/windows/glib
@@ -183,7 +187,19 @@ android_target_include_directories(
../os/windows
..)
android_target_compile_definitions(
- glib2 windows PRIVATE UNICODE _UNICODE HAVE_ISNAN_IN_LIBC HAVE_ISNAND_IN_LIBC
- HAVE_ISNANF_IN_LIBC HAVE_ISNANL_IN_LIBC)
-android_target_link_libraries(glib2 windows PUBLIC ws2_32::ws2_32)
-android_install_shared(glib2)
+ glib2_${ANDROID_TARGET_TAG} windows
+ PRIVATE UNICODE _UNICODE HAVE_ISNAN_IN_LIBC HAVE_ISNAND_IN_LIBC
+ HAVE_ISNANF_IN_LIBC HAVE_ISNANL_IN_LIBC)
+android_target_link_libraries(glib2_${ANDROID_TARGET_TAG} windows
+ PUBLIC ws2_32::ws2_32)
+android_install_shared(glib2_${ANDROID_TARGET_TAG})
+
+add_library(glib2 ALIAS glib2_${ANDROID_TARGET_TAG})
+android_license(
+ TARGET "glib2"
+ LIBNAME glib-2.0
+ URL "https://android.googlesource.com/platform/external/bluetooth/glib/+/refs/heads/emu-master-dev/"
+ SPDX "LGPL-2.1-only"
+ LICENSE
+ "https://android.googlesource.com/platform/external/bluetooth/glib/+/refs/heads/emu-master-dev/COPYING"
+ LOCAL "${ANDROID_QEMU2_TOP_DIR}/LICENSES/LICENSE.LGPLv21")