[llvm-branch-commits] [llvm] 65270fa - [CMake] Support undefined LLVM_NATIVE_ARCH in llvm_map_components_to_libnames().

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 31 23:43:05 PST 2023


Author: Ivan Kosarev
Date: 2023-02-01T08:42:48+01:00
New Revision: 65270fa704ba21f3b5e1632ae32aa8ea903b1668

URL: https://github.com/llvm/llvm-project/commit/65270fa704ba21f3b5e1632ae32aa8ea903b1668
DIFF: https://github.com/llvm/llvm-project/commit/65270fa704ba21f3b5e1632ae32aa8ea903b1668.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

(cherry picked from commit 2e3153059c268700d4b399a8cbba28e9c2514e09)

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-branch-commits mailing list