[libc-commits] [PATCH] D138040: [libc] Fix tablegen when using a runtimes build

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Nov 15 10:10:05 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG93d1a7bfc180: [libc] Fix tablegen when using a runtimes build (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138040/new/

https://reviews.llvm.org/D138040

Files:
  libc/CMakeLists.txt
  libc/utils/HdrGen/CMakeLists.txt
  libc/utils/LibcTableGenUtil/CMakeLists.txt


Index: libc/utils/LibcTableGenUtil/CMakeLists.txt
===================================================================
--- libc/utils/LibcTableGenUtil/CMakeLists.txt
+++ libc/utils/LibcTableGenUtil/CMakeLists.txt
@@ -4,4 +4,4 @@
   APIIndexer.h
   LINK_COMPONENTS Support TableGen
 )
-target_include_directories(LibcTableGenUtil PUBLIC ${LIBC_SOURCE_DIR})
+target_include_directories(LibcTableGenUtil PUBLIC ${LIBC_SOURCE_DIR} ${LLVM_LIBC_INCLUDE_DIRS})
Index: libc/utils/HdrGen/CMakeLists.txt
===================================================================
--- libc/utils/HdrGen/CMakeLists.txt
+++ libc/utils/HdrGen/CMakeLists.txt
@@ -12,7 +12,7 @@
   PublicAPICommand.h
 )
 
-target_include_directories(libc-hdrgen PRIVATE ${LIBC_SOURCE_DIR})
+target_include_directories(libc-hdrgen PRIVATE ${LIBC_SOURCE_DIR} ${LLVM_LIBC_INCLUDE_DIRS})
 target_link_libraries(libc-hdrgen PRIVATE LibcTableGenUtil)
 
 add_subdirectory(PrototypeTestGen)
Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -14,6 +14,12 @@
 # The top-level directory in which libc is being built.
 set(LIBC_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
 
+# For a runtimes build we need to manually include tablgen and LLVM directories.
+if ("libc" IN_LIST LLVM_ENABLE_RUNTIMES)
+  include(TableGen)
+  set(LLVM_LIBC_INCLUDE_DIRS ${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include)
+endif()
+
 # Path libc/scripts directory.
 set(LIBC_BUILD_SCRIPTS_DIR "${LIBC_SOURCE_DIR}/utils/build_scripts")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138040.475513.patch
Type: text/x-patch
Size: 1554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20221115/10d64144/attachment-0001.bin>


More information about the libc-commits mailing list