[CMake] Make libLLVM functionable for Android
authorKudryashov Evgeny <ka6ash@gmail.com>
Tue, 10 Jan 2023 14:01:36 +0000 (06:01 -0800)
committerPhoebe Wang <phoebe.wang@intel.com>
Wed, 11 Jan 2023 02:18:50 +0000 (18:18 -0800)
libLLVM.so is empty if it is built with Android NDK (`-DLLVM_BUILD_LLVM_DYLIB=ON`). The patch fixes it.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D140268

llvm/tools/llvm-shlib/CMakeLists.txt

index eb4d989..90e2904 100644 (file)
@@ -39,6 +39,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
      OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
      OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
      OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
+     OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
      OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME: It should be "GNU ld for elf"
     configure_file(
     ${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in