aboutsummaryrefslogtreecommitdiff
path: root/libc/CMakeLists.txt
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-05-22 16:00:41 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-05-22 22:24:57 -0500
commit4fafa39b76b8e11960a75d7b15d762840330ecbf (patch)
tree8a8963b047e807f2853df0a7e92562276f6fa4f1 /libc/CMakeLists.txt
parent52bc4b16cb68d6d64c0d9499b2e6c1d719e78085 (diff)
downloadllvm-4fafa39b76b8e11960a75d7b15d762840330ecbf.zip
llvm-4fafa39b76b8e11960a75d7b15d762840330ecbf.tar.gz
llvm-4fafa39b76b8e11960a75d7b15d762840330ecbf.tar.bz2
[libc] Add an option to make `libc` only build the `libc-hdrgen` tool
The `libc-hdergen` tool is required for cross-builds, however some cases can cause issues when configuring this build. This patch adds an ovveride option `LIBC_HDRGEN_ONLY` to allow us to retain the old (incorrect) behaviour where `libc` would not build with any other runtimes enabled. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D151155
Diffstat (limited to 'libc/CMakeLists.txt')
-rw-r--r--libc/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 62bfee9..80e9ead 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -28,7 +28,9 @@ if(LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
endif()
endif()
-if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD)
+option(LIBC_HDRGEN_ONLY "Only build the 'libc-hdrgen' executable" OFF)
+if(("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD) OR
+ LIBC_HDRGEN_ONLY)
# When libc is build as part of the runtimes/bootstrap build's CMake run, we
# only need to build the host tools to build the libc. So, we just do enough
# to build libc-hdrgen and return.