[libc-commits] [libc] eb71ecf - [libc] Fix GPU include directories not being set properly

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Feb 20 13:43:40 PST 2023


Author: Joseph Huber
Date: 2023-02-20T15:43:16-06:00
New Revision: eb71ecfa1018eb5bc54f59526b2e493651e61f0c

URL: https://github.com/llvm/llvm-project/commit/eb71ecfa1018eb5bc54f59526b2e493651e61f0c
DIFF: https://github.com/llvm/llvm-project/commit/eb71ecfa1018eb5bc54f59526b2e493651e61f0c.diff

LOG: [libc] Fix GPU include directories not being set properly

Summary:
For some reason, this variable was set after where it was used. Causing
weird behaviour with including the standard headers. Fix it.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCObjectRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index 6947d623bb2c..806859a37b7b 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -82,6 +82,8 @@ function(_build_gpu_objects fq_target_name internal_target_name)
     ${ARGN}
   )
 
+  set(include_dirs ${LIBC_BUILD_DIR}/include ${LIBC_SOURCE_DIR} ${LIBC_BUILD_DIR})
+
   # The packaged version will be built for every target GPU architecture. We do
   # this so we can support multiple accelerators on the same machine.
   foreach(gpu_arch ${all_gpu_architectures})
@@ -166,7 +168,6 @@ function(_build_gpu_objects fq_target_name internal_target_name)
                    ${full_deps_list} ${packaged_target_name} ${stub_target_name})
 
   # We only build the internal target for a single supported architecture.
-  set(include_dirs ${LIBC_BUILD_DIR}/include ${LIBC_SOURCE_DIR} ${LIBC_BUILD_DIR})
   if(LIBC_GPU_TARGET_ARCHITECTURE_IS_AMDGPU OR
      LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX)
     add_library(


        


More information about the libc-commits mailing list