[PATCH] D88157: [CMake] Make sure _cmake_system_name gets set

David Tenty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 09:01:34 PDT 2020


daltenty created this revision.
daltenty added reviewers: stevewan, hubert.reinterpretcast, jasonliu.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.
daltenty requested review of this revision.

since currently it won't be if there isn't an explicit CMake option passed
llvm_ExternalProject_Add and we'll make decisions about what tools to use
for the build base on the setting.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88157

Files:
  llvm/cmake/modules/LLVMExternalProjectUtils.cmake


Index: llvm/cmake/modules/LLVMExternalProjectUtils.cmake
===================================================================
--- llvm/cmake/modules/LLVMExternalProjectUtils.cmake
+++ llvm/cmake/modules/LLVMExternalProjectUtils.cmake
@@ -52,6 +52,11 @@
     endif()
   endforeach()
 
+  # if CMAKE_SYSTEM_NAME doesn't get set, CMake will target the host.
+  if (NOT _cmake_system_name)
+    set(_cmake_system_name "${CMAKE_HOST_SYSTEM_NAME}")
+  endif()
+
   if(NOT ARG_TOOLCHAIN_TOOLS)
     set(ARG_TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objdump)
     if(_cmake_system_name STREQUAL Darwin)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88157.293764.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200923/a1085f42/attachment.bin>


More information about the llvm-commits mailing list