[libc-commits] [PATCH] D151155: [libc] Add an option to make `libc` only build the `libc-hdrgen` tool

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon May 22 14:02:08 PDT 2023


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

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151155

Files:
  libc/CMakeLists.txt


Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -28,7 +28,8 @@
   endif()
 endif()
 
-if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD)
+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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151155.524483.patch
Type: text/x-patch
Size: 544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230522/a2b483c6/attachment.bin>


More information about the libc-commits mailing list