[libc] [llvm] [libc][cmake][linux] require new LLVM_LIBC_USE_HOST_KERNEL_HEADERS or LIBC_KERNEL_HEADERS (PR #123820)
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 29 09:29:08 PST 2025
================
@@ -46,7 +46,11 @@ set(LIBC_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(LIBC_ENABLE_USE_BY_CLANG OFF CACHE BOOL "Whether or not to place libc in a build directory findable by a just built clang")
-set(LIBC_KERNEL_HEADERS "/usr/include" CACHE STRING "Path to Linux kernel headers")
+# LLVM_LIBC_USE_HOST_KERNEL_HEADERS is brittle, and frowned upon (prefer
+# setting LIBC_KERNEL_HEADERS), but is simpler from a hello world linux host
+# build.
+set(LLVM_LIBC_USE_HOST_KERNEL_HEADERS OFF CACHE BOOL "Add /usr/include to the header seach path")
+set(LIBC_KERNEL_HEADERS "" CACHE STRING "Path to Linux kernel headers")
----------------
nickdesaulniers wrote:
Ok, so it sounds like cmake has distinct "namespace-esque" differentiation between "normal variables" and "cache variables."
For cmake variables that we encourage folks to use to configure llvm-libc, I _think_ we may want `option`. That seems very common in `libcxx/CMakeLists.txt`.
https://github.com/llvm/llvm-project/pull/123820
More information about the llvm-commits
mailing list