Skip to content

Commit

Permalink
[libc] Add an option to make libc only build the libc-hdrgen tool
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jhuber6 committed May 23, 2023
1 parent 52bc4b1 commit 4fafa39
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4fafa39

Please sign in to comment.