-
Notifications
You must be signed in to change notification settings - Fork 254
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
Support MSVC architectures #525
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ssrobins, thanks so much for this contribution!
This is excellent. Just one small comment, since version 3.27 (just released), CMAKE_GENERATOR_PLATFORM
can contain more information (comma-separated key-value pairs) - so in those instances the STREQUAL
would fail.
If CMAKE_VS_PLATFORM_NAME
is already defined at this stage - I would probably inspect that variable instead, as that contains just the platform without the additional information.
Otherwise we would need to split the string to only extract the platform bit
I've had a chance to review this further - indeed I can see that On the other hand, there's a potential bug that can occur in the following block, because
if CMake is invoked on a Windows/ARM64 machine (like the 5G Surface Pro, Windows DevKit, etc) - it will unconditionally return Perhaps we can consider ignoring |
@jcar87 I reconfigured it so it only uses one architecture variable per platform. I also switched to |
Just checking in on this one, in case it fell off your radar. If you're busy, no big deal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot for the refactoring! just a couple more comments
conan_provider.cmake
Outdated
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES arm64) | ||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS") | ||
set(host_arch ${CMAKE_OSX_ARCHITECTURES}) | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it not make sense to check for MSVC
instead? Based on the discussions in CMake, my understanding was that CMAKE_CXX_COMPILER_ARCHITECTURE_ID
is well defined for msvc, but may not be for others - assuming other compilers may be used in Windows, like gcc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixed
conan_provider.cmake
Outdated
set(_ARCH x86) | ||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64|amd64|x86_64" OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64) | ||
elseif(host_arch MATCHES "amd64|x86_64|x64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is AMD64
being removed? is it the case that MATCHES
will match them regardless of lower-case/upper-case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMAKE_CXX_COMPILER_ARCHITECTURE_ID
lists the arch as x64
, but since CMAKE_SYSTEM_PROCESSOR
could still be used for non-MSVC compilers on Windows, I put it back.
@jcar87 any other feedback on this one or is it ready to merge? |
Sorry that this has been stuck for a while, I'll sync with @jcar87 about this and try to move it forward, thanks for your patience! |
e0fdaf4
to
024f106
Compare
Merged changes from conan-io/cmake-conan#525
Could this be merged, please? The patch works well (both |
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Ok, sorry about that. |
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Merged changes from conan-io/cmake-conan#525
Use the value of
CMAKE_GENERATOR_PLATFORM
to determine the target architectures on Windows with MSVC sinceCMAKE_SYSTEM_PROCESSOR
doesn't work as expected.