[libc-commits] [libc] [libc] support out of tree build with dynlibs (PR #97959)

via libc-commits libc-commits at lists.llvm.org
Sun Jul 7 11:31:08 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Schrodinger ZHU Yifan (SchrodingerZhu)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/97959.diff


2 Files Affected:

- (modified) libc/utils/HdrGen/CMakeLists.txt (+3-1) 
- (modified) libc/utils/LibcTableGenUtil/CMakeLists.txt (+6-2) 


``````````diff
diff --git a/libc/utils/HdrGen/CMakeLists.txt b/libc/utils/HdrGen/CMakeLists.txt
index 0ec1cba542d40..47f845b9f9a5b 100644
--- a/libc/utils/HdrGen/CMakeLists.txt
+++ b/libc/utils/HdrGen/CMakeLists.txt
@@ -1,6 +1,8 @@
 include(TableGen)
 
-set(LLVM_LINK_COMPONENTS Support)
+if (NOT LLVM_LINK_LLVM_DYLIB)
+  set(LLVM_LINK_COMPONENTS Support)
+endif()
 
 add_tablegen(libc-hdrgen LIBC
   Command.h
diff --git a/libc/utils/LibcTableGenUtil/CMakeLists.txt b/libc/utils/LibcTableGenUtil/CMakeLists.txt
index dca6a7bb83065..9421383394a35 100644
--- a/libc/utils/LibcTableGenUtil/CMakeLists.txt
+++ b/libc/utils/LibcTableGenUtil/CMakeLists.txt
@@ -1,9 +1,13 @@
+if (NOT LLVM_LINK_LLVM_DYLIB)
+  set(flags "DISABLE_LLVM_LINK_LLVM_DYLIB;LINK_COMPONENTS;Support;TableGen")
+else()
+  set(flags "LINK_COMPONENTS;TableGen")
+endif()
 add_llvm_library(
   LibcTableGenUtil
   APIIndexer.cpp
   APIIndexer.h
-  DISABLE_LLVM_LINK_LLVM_DYLIB
-  LINK_COMPONENTS Support TableGen
+  ${flags}
 )
 target_include_directories(LibcTableGenUtil PUBLIC ${LIBC_SOURCE_DIR})
 target_include_directories(LibcTableGenUtil PRIVATE ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR})

``````````

</details>


https://github.com/llvm/llvm-project/pull/97959


More information about the libc-commits mailing list