Skip to content

Commit

Permalink
[libc] support out of tree build with dynlibs (llvm#97959)
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingerZhu committed Jul 7, 2024
1 parent 1b26bb0 commit f13463e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion libc/utils/HdrGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions libc/utils/LibcTableGenUtil/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})

0 comments on commit f13463e

Please sign in to comment.