[PATCH] D121034: [cmake] Set variables before saving them

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 17:18:27 PST 2022


smeenai created this revision.
smeenai added reviewers: mstorsjo, thakis, ychen.
Herald added a subscriber: mgorny.
Herald added a project: All.
smeenai requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Otherwise init_user_prop will just save empty values for these
variables, which will break sub-configures.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121034

Files:
  llvm/cmake/platforms/WinMsvc.cmake


Index: llvm/cmake/platforms/WinMsvc.cmake
===================================================================
--- llvm/cmake/platforms/WinMsvc.cmake
+++ llvm/cmake/platforms/WinMsvc.cmake
@@ -169,6 +169,14 @@
 set(CMAKE_SYSTEM_VERSION 10.0)
 set(CMAKE_SYSTEM_PROCESSOR AMD64)
 
+if (NOT MSVC_VER)
+  get_highest_version("${LLVM_WINSYSROOT}/VC/Tools/MSVC" MSVC_VER)
+endif()
+
+if (NOT WINSDK_VER)
+  get_highest_version("${LLVM_WINSYSROOT}/Windows Kits/10/Include" WINSDK_VER)
+endif()
+
 init_user_prop(HOST_ARCH)
 init_user_prop(LLVM_NATIVE_TOOLCHAIN)
 init_user_prop(LLVM_WINSYSROOT)
@@ -204,14 +212,6 @@
           "binaries")
 endif()
 
-if (NOT MSVC_VER)
-  get_highest_version("${LLVM_WINSYSROOT}/VC/Tools/MSVC" MSVC_VER)
-endif()
-
-if (NOT WINSDK_VER)
-  get_highest_version("${LLVM_WINSYSROOT}/Windows Kits/10/Include" WINSDK_VER)
-endif()
-
 if (NOT LLVM_WINSYSROOT OR NOT MSVC_VER OR NOT WINSDK_VER)
   message(SEND_ERROR
           "Must specify CMake variable LLVM_WINSYSROOT, MSVC_VER and WINSDK_VER")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121034.413175.patch
Type: text/x-patch
Size: 1017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220305/b5877eef/attachment.bin>


More information about the llvm-commits mailing list