[libc-commits] [libc] [libc] fix type generic stdc_leading_zeros for GCC (PR #79917)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue Jan 30 15:20:04 PST 2024


jhuber6 wrote:

> Fixed in [0129ff1](https://github.com/llvm/llvm-project/commit/0129ff17a9885d76d3700fee56500848c28e3fc1). Sorry about that!
> 
> @jhuber6 I think we can simplify the condition further to just:
> 
> ```cmake
> if(libc.include.stdbit IN_LIST TARGET_PUBLIC_HEADERS)
> ```
> 
> (I'm guessing that `TARGET_PUBLIC_HEADERS` is empty when `LLVM_LIBC_FULL_BUILD` is not set?)

Don't think so, but we could alter the logic to do that if it's the desire behavior.
```diff
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 6d385849b6a6..66d8f702d420 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -314,7 +314,7 @@ else()
 endif()
 
 # Check headers.txt
-if(EXISTS "${LIBC_CONFIG_PATH}/headers.txt")
+if(EXISTS "${LIBC_CONFIG_PATH}/headers.txt" AND LLVM_LIBC_FULL_BUILD)
     include("${LIBC_CONFIG_PATH}/headers.txt")
 elseif(LLVM_LIBC_FULL_BUILD)
   message(FATAL_ERROR "${LIBC_CONFIG_PATH}/headers.txt file not found and fullbuild requested.")
```
Or something. might break something else, who knows.

https://github.com/llvm/llvm-project/pull/79917


More information about the libc-commits mailing list