diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt index 62bfee9f089ac..80e9ead40db64 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.