[llvm] 2e31530 - [CMake] Support undefined LLVM_NATIVE_ARCH in llvm_map_components_to_libnames().

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 11:37:36 PST 2023


Author: Ivan Kosarev
Date: 2023-01-26T19:37:01Z
New Revision: 2e3153059c268700d4b399a8cbba28e9c2514e09

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

LOG: [CMake] Support undefined LLVM_NATIVE_ARCH in llvm_map_components_to_libnames().

https://reviews.llvm.org/D142405 made this function relying on the
LLVM_NATIVE_ARCH be defined, which is not necessarily the case for
third-party projects that include LLVM as their part.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D142610

Added: 
    

Modified: 
    llvm/cmake/modules/LLVM-Config.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/LLVM-Config.cmake b/llvm/cmake/modules/LLVM-Config.cmake
index a5a7be61dce0a..37eab12e7460b 100644
--- a/llvm/cmake/modules/LLVM-Config.cmake
+++ b/llvm/cmake/modules/LLVM-Config.cmake
@@ -236,7 +236,7 @@ function(llvm_map_components_to_libnames out_libs)
       list(APPEND link_components "interpreter")
     endif()
   endif()
-  if(native IN_LIST link_components AND ${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD)
+  if(native IN_LIST link_components AND "${LLVM_NATIVE_ARCH}" IN_LIST LLVM_TARGETS_TO_BUILD)
     list(APPEND link_components ${LLVM_NATIVE_ARCH})
   endif()
 


        


More information about the llvm-commits mailing list