[libc-commits] [PATCH] D151011: CMake][libc] Fix non-runtime build when other runtimes are enabled

Aiden Grossman via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri May 19 20:33:43 PDT 2023


aidengrossman created this revision.
aidengrossman added reviewers: lntue, sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
aidengrossman requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151011

Files:
  libc/CMakeLists.txt


Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -28,7 +28,7 @@
   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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151011.523987.patch
Type: text/x-patch
Size: 504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230520/3c61bfdb/attachment.bin>


More information about the libc-commits mailing list