Skip to content

Commit f13463e

Browse files
[libc] support out of tree build with dynlibs (#97959)
1 parent 1b26bb0 commit f13463e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

libc/utils/HdrGen/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
include(TableGen)
22

3-
set(LLVM_LINK_COMPONENTS Support)
3+
if (NOT LLVM_LINK_LLVM_DYLIB)
4+
set(LLVM_LINK_COMPONENTS Support)
5+
endif()
46

57
add_tablegen(libc-hdrgen LIBC
68
Command.h
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
if (NOT LLVM_LINK_LLVM_DYLIB)
2+
set(flags "DISABLE_LLVM_LINK_LLVM_DYLIB;LINK_COMPONENTS;Support;TableGen")
3+
else()
4+
set(flags "LINK_COMPONENTS;TableGen")
5+
endif()
16
add_llvm_library(
27
LibcTableGenUtil
38
APIIndexer.cpp
49
APIIndexer.h
5-
DISABLE_LLVM_LINK_LLVM_DYLIB
6-
LINK_COMPONENTS Support TableGen
10+
${flags}
711
)
812
target_include_directories(LibcTableGenUtil PUBLIC ${LIBC_SOURCE_DIR})
913
target_include_directories(LibcTableGenUtil PRIVATE ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR})

0 commit comments

Comments
 (0)