[libc-commits] [libc] 742446a - [CMake][libc] Fix non-runtime build when other runtimes are enabled

Aiden Grossman via libc-commits libc-commits at lists.llvm.org
Sat May 20 15:33:59 PDT 2023


Author: Aiden Grossman
Date: 2023-05-20T22:33:14Z
New Revision: 742446a837ba7edc27d614a330cb3a74338d11ff

URL: https://github.com/llvm/llvm-project/commit/742446a837ba7edc27d614a330cb3a74338d11ff
DIFF: https://github.com/llvm/llvm-project/commit/742446a837ba7edc27d614a330cb3a74338d11ff.diff

LOG: [CMake][libc] Fix non-runtime build when other runtimes are enabled

Before this patch, when other runtimes were enabled by setting
LLVM_ENABLE_RUNTIMES and llvm libc was built as a project by setting
LLVM_ENABLE_PROJECTS, the llvm libc CMake system would delay
configuration until the runtime build which never started since libc
wasn't declared as one of the runtime builds. This patch fixes this
behavior by explicitly checking that libc is within LLVM_ENABLE_RUNTIMES
rather than just the variable being set at all.

Reviewed By: Intue

Differential Revision: https://reviews.llvm.org/D151011

Added: 
    

Modified: 
    libc/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index e0e5b69b47cf8..62bfee9f089ac 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -28,7 +28,7 @@ if(LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
   endif()
 endif()
 
-if(LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD)
+if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD)
   # 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.


        


More information about the libc-commits mailing list