aboutsummaryrefslogtreecommitdiffstats
path: root/build/export_generators/hardcoded-cmake/cmake/global_flags.linker.gnu.cmake
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-07-28 17:10:28 +0300
committeralexv-smirnov <alex@ydb.tech>2023-07-28 17:10:28 +0300
commitc8ce88b2d80cb6860aa97818c49d65b90c7bd31b (patch)
treebe14b6f8d5b8fd6e264a047a22dc78d760981159 /build/export_generators/hardcoded-cmake/cmake/global_flags.linker.gnu.cmake
parent128317b5f4cb38480a6c3407e25a144ce3026a1c (diff)
downloadydb-c8ce88b2d80cb6860aa97818c49d65b90c7bd31b.tar.gz
Add yexport export generators
Diffstat (limited to 'build/export_generators/hardcoded-cmake/cmake/global_flags.linker.gnu.cmake')
-rw-r--r--build/export_generators/hardcoded-cmake/cmake/global_flags.linker.gnu.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/build/export_generators/hardcoded-cmake/cmake/global_flags.linker.gnu.cmake b/build/export_generators/hardcoded-cmake/cmake/global_flags.linker.gnu.cmake
new file mode 100644
index 0000000000..5b32a8868f
--- /dev/null
+++ b/build/export_generators/hardcoded-cmake/cmake/global_flags.linker.gnu.cmake
@@ -0,0 +1,25 @@
+if (ANDROID)
+ # NDK r23 onwards has stopped using libgcc:
+ # - https://github.com/android/ndk/wiki/Changelog-r23#changes
+ # - https://github.com/android/ndk/issues/1230
+ # LLVM's libunwind is now used instead of libgcc for all architectures rather than just 32-bit Arm.
+ # - https://github.com/android/ndk/issues/1231
+ # LLVM's libclang_rt.builtins is now used instead of libgcc.
+ if (CMAKE_ANDROID_NDK_VERSION GREATER_EQUAL 23)
+ # Use toolchain defaults to link with libunwind/clang_rt.builtins
+ add_link_options("-nostdlib++")
+ else ()
+ # Preserve old behaviour: specify runtime libs manually
+ add_link_options(-nodefaultlibs)
+ link_libraries(gcc)
+ if (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a")
+ link_libraries(unwind)
+ endif()
+ endif()
+elseif (CMAKE_SYSTEM_NAME MATCHES "^(Darwin|Linux)$")
+ add_link_options("-nodefaultlibs")
+endif()
+
+if (APPLE)
+ set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
+endif()