summaryrefslogtreecommitdiff
path: root/libc/CMakeLists.txt
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2022-11-15 10:25:27 -0600
committerJoseph Huber <jhuber6@vols.utk.edu>2022-11-15 12:09:52 -0600
commit93d1a7bfc1808c89096ef092439be703830b28ac (patch)
tree059dff6af10e14a09a0ba6fc647aaa06ed933efb /libc/CMakeLists.txt
parent8e37b53360484f07a24ba07cf61b7553ffcc42ae (diff)
downloadllvm-93d1a7bfc1808c89096ef092439be703830b28ac.tar.gz
[libc] Fix tablegen when using a runtimes build
When using `LLVM_ENABLE_RUNTIMES=libc` we need to perform a few extra steps to include LLVM utilities similar to if we were performing a standalone build. Libc depends on the tablegen utilities and the LLVM libraries when performing a full build. When using an `LLVM_ENABLE_PROJECTS=libc` build these are included as a part of the greater LLVM build, but here we need to perform it maunally. This patch should allow using `LLVM_LIBC_FULL_BUILD=ON` when building with runtimes. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D138040
Diffstat (limited to 'libc/CMakeLists.txt')
-rw-r--r--libc/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index eff5e00453f5..377c871eb242 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -14,6 +14,12 @@ set(LIBC_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
# 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")