-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix comparing SYSTEM_PROCESSOR with win32. #4374
base: main
Are you sure you want to change the base?
Fix comparing SYSTEM_PROCESSOR with win32. #4374
Conversation
This is going to be a processor type like x86, x64, arm, or arm64. This change was originally authored by @LilyWangLL in microsoft/vcpkg#39475
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4374 +/- ##
==========================================
- Coverage 87.05% 86.59% -0.47%
==========================================
Files 56 56
Lines 17354 17354
==========================================
- Hits 15107 15027 -80
- Misses 2247 2327 +80 ☔ View full report in Codecov by Sentry. |
@BillyONeal this broke several of our builds in automation |
It looks like the values in the repo are broken for non-VS generators, while this change is broken for VS generators. I suppose it can just check for either. I observe that there's a checked in .pgd file with unusual linker settings getting dragged in here too |
Ah, I see. This is a bit o_O: Lines 438 to 442 in 8a741dc
@nibanks Would you like to see a change to consistently compare with I think the right thing to do is to always supply diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f8f4d58f..343b3cf47 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -435,10 +435,17 @@ if (NOT MSVC AND NOT APPLE AND NOT ANDROID)
endif()
endif()
-if (CMAKE_GENERATOR_PLATFORM STREQUAL "")
-string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} SYSTEM_PROCESSOR)
+if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "")
+ string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSTEM_PROCESSOR)
else()
-string(TOLOWER ${CMAKE_GENERATOR_PLATFORM} SYSTEM_PROCESSOR)
+ string(TOLOWER "${CMAKE_GENERATOR_PLATFORM}" SYSTEM_PROCESSOR)
+ # Translate from Visual Studio generator platform values to
+ # CMAKE_SYSTEM_PROCESSOR values (derived from %PROCESSOR_ARCHITECTURE%)
+ if ("${SYSTEM_PROCESSOR}" STREQUAL "win32")
+ set(SYSTEM_PROCESSOR "x86")
+ elseif ("${SYSTEM_PROCESSOR}" STREQUAL "x64")
+ set(SYSTEM_PROCESSOR "amd64")
+ endif()
endif()
if(WIN32) But the existing behavior e.g. msquic/submodules/CMakeLists.txt Line 67 in 8a741dc
checks for both x64 (which would be the (And if that seems funny and inconsistent, I'm sorry: Microsoft Windows [Version 10.0.22631.3737]
(c) Microsoft Corporation. All rights reserved.
D:\>echo %PROCESSOR_ARCHITECTURE%
AMD64
D:\>C:\Windows\Syswow64\cmd.exe
Microsoft Windows [Version 10.0.22631.3737]
(c) Microsoft Corporation. All rights reserved.
D:\>echo %PROCESSOR_ARCHITECTURE%
x86
D:\> ) |
If it helps make the choice, I observe that
|
Also fix uwp builds so that all ci.baseline.txt entries can be removed, submitted upstream as microsoft/msquic#4373 Also fix x86-windows builds which incorrectly compared SYSTEM_PROCESSOR with 'win32' rather than 'x86'. Submitted upstream as microsoft/msquic#4374 . This patch originally authored by @LillyWangLL Originally started from #39475 Co-authored by: Lily Wang <[email protected]>
Just curious which resolution you would like so I can fix the broken builds? |
I really don't have a strong preference so long as we don't break anything. |
Still an issue. |
This is going to be a processor type like x86, x64, arm, or arm64.
This change was originally authored by @LilyWangLL in microsoft/vcpkg#39475
See https://cmake.org/cmake/help/latest/variable/CMAKE_HOST_SYSTEM_PROCESSOR.html