[PATCH] D80866: [cmake] Allow llvm_ExternalProject_Add to find CMAKE_SYSTEM_NAME among ${proj}_CMAKE_ARGS
Kristina Bessonova via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 30 05:48:30 PDT 2020
krisb created this revision.
krisb added reviewers: smeenai, phosek, compnerd.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.
llvm_ExternalProject_Add requires CMAKE_SYSTEM_NAME to be passed to set
correct toolchain tools, for example, for Windows.
But there are no other ways to do this for a default configuration of a
runtimes/builtins project, except using RUNTIMES_CMAKE_ARGS/BUILTINS_CMAKE_ARGS.
So, it is worth to account these variables while searching for CMAKE_SYSTEM_NAME.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80866
Files:
llvm/cmake/modules/LLVMExternalProjectUtils.cmake
Index: llvm/cmake/modules/LLVMExternalProjectUtils.cmake
===================================================================
--- llvm/cmake/modules/LLVMExternalProjectUtils.cmake
+++ llvm/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -51,6 +51,13 @@
string(REGEX REPLACE "^-DCMAKE_SYSTEM_NAME=(.*)$" "\\1" _cmake_system_name "${arg}")
endif()
endforeach()
+ if(NOT _cmake_system_name)
+ foreach(arg ${${nameCanon}_CMAKE_ARGS})
+ if(arg MATCHES "^-DCMAKE_SYSTEM_NAME=")
+ string(REGEX REPLACE "^-DCMAKE_SYSTEM_NAME=(.*)$" "\\1" _cmake_system_name "${arg}")
+ endif()
+ endforeach()
+ endif()
if(NOT ARG_TOOLCHAIN_TOOLS)
set(ARG_TOOLCHAIN_TOOLS clang lld llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objdump)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80866.267453.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200530/4c6cffdc/attachment.bin>
More information about the llvm-commits
mailing list