[libc-commits] [libc] [libc] Only use COMPILER_RESOURCE_DIR if available (PR #97465)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 2 12:42:48 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

<details>
<summary>Changes</summary>

This avoids build error when COMPILER_RESOURCE_DIR is unset.

---
Full diff: https://github.com/llvm/llvm-project/pull/97465.diff


1 Files Affected:

- (modified) libc/cmake/modules/LLVMLibCCompileOptionRules.cmake (+1-1) 


``````````diff
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index d283e966bffcf..28379213029a3 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -50,7 +50,7 @@ function(_get_common_compile_options output_var flags)
       # being included.
       if(LIBC_CC_SUPPORTS_NOSTDLIBINC)
         list(APPEND compile_options "-nostdlibinc")
-      else()
+      elseif(COMPILER_RESOURCE_DIR)
         list(APPEND compile_options "-isystem${COMPILER_RESOURCE_DIR}/include")
         list(APPEND compile_options "-nostdinc")
       endif()

``````````

</details>


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


More information about the libc-commits mailing list