[llvm] ac313c3 - WinMsvc.cmake: try lower-case include/lib when searching for windows SDK
Yuanfang Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 17 16:31:10 PST 2021
Author: Yuanfang Chen
Date: 2021-12-17T16:30:36-08:00
New Revision: ac313c37e17e0e6ab9f7db2e5a9b6ba7c0b7be9f
URL: https://github.com/llvm/llvm-project/commit/ac313c37e17e0e6ab9f7db2e5a9b6ba7c0b7be9f
DIFF: https://github.com/llvm/llvm-project/commit/ac313c37e17e0e6ab9f7db2e5a9b6ba7c0b7be9f.diff
LOG: WinMsvc.cmake: try lower-case include/lib when searching for windows SDK
if the pascal case ones failed. Some tools, like msvc-wine/xwin, use the
lower case.
Added:
Modified:
llvm/cmake/platforms/WinMsvc.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/platforms/WinMsvc.cmake b/llvm/cmake/platforms/WinMsvc.cmake
index b538d65f0f81..9a5078894182 100644
--- a/llvm/cmake/platforms/WinMsvc.cmake
+++ b/llvm/cmake/platforms/WinMsvc.cmake
@@ -214,6 +214,14 @@ if(NOT EXISTS "${MSVC_BASE}" OR
"system headers and libraries")
endif()
+# Try lowercase `include`/`lib` used by xwin/msvc-wine
+if(NOT EXISTS "${WINSDK_INCLUDE}")
+ set(WINSDK_INCLUDE "${WINSDK_BASE}/include/${WINSDK_VER}")
+endif()
+if(NOT EXISTS "${WINSDK_LIB}")
+ set(WINSDK_LIB "${WINSDK_BASE}/lib/${WINSDK_VER}")
+endif()
+
if(NOT EXISTS "${WINSDK_BASE}" OR
NOT EXISTS "${WINSDK_INCLUDE}" OR
NOT EXISTS "${WINSDK_LIB}")
@@ -261,7 +269,7 @@ if(case_sensitive_filesystem)
init_user_prop(winsdk_vfs_overlay_path)
if(NOT winsdk_vfs_overlay_path)
set(winsdk_vfs_overlay_path "${CMAKE_BINARY_DIR}/winsdk_vfs_overlay.yaml")
- generate_winsdk_vfs_overlay("${WINSDK_BASE}/Include/${WINSDK_VER}" "${winsdk_vfs_overlay_path}")
+ generate_winsdk_vfs_overlay("${WINSDK_INCLUDE}" "${winsdk_vfs_overlay_path}")
init_user_prop(winsdk_vfs_overlay_path)
endif()
list(APPEND COMPILE_FLAGS
@@ -296,7 +304,7 @@ if(case_sensitive_filesystem)
init_user_prop(winsdk_lib_symlinks_dir)
if(NOT winsdk_lib_symlinks_dir)
set(winsdk_lib_symlinks_dir "${CMAKE_BINARY_DIR}/winsdk_lib_symlinks")
- generate_winsdk_lib_symlinks("${WINSDK_BASE}/Lib/${WINSDK_VER}/um/${WINSDK_ARCH}" "${winsdk_lib_symlinks_dir}")
+ generate_winsdk_lib_symlinks("${WINSDK_LIB}/um/${WINSDK_ARCH}" "${winsdk_lib_symlinks_dir}")
init_user_prop(winsdk_lib_symlinks_dir)
endif()
list(APPEND LINK_FLAGS
More information about the llvm-commits
mailing list