Skip to content
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

Don't set CMAKE_SYSTEM_NAME when using the Visual Studio generator #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrose-signal
Copy link

Setting CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR is often enough for CMake to handle cross-compilation even without a toolchain file, but it gets in the way of generators that handle cross-compilation on their own (in Visual Studio's case, using the -T "toolset" option).

Narrow fix for the issue I brought up in #158 (comment). Possible fix for #171 as well, if it does turn out to be the same thing.

Setting CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR is often enough for
CMake to handle cross-compilation even without a toolchain file, but it
gets in the way of generators that handle cross-compilation on their own
(in Visual Studio's case, using the -T "toolset" option).
Comment on lines +460 to +464
&& !(msvc
&& self
.generator
.as_deref()
.map_or(true, |g| g.to_string_lossy().starts_with("Visual Studio")))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely weirdly complicated for an inline condition, and depends on the default generator choice for MSVC being Visual Studio (implemented below, unchanged). Suggestions welcome on how to reorganize this.

@jrose-signal
Copy link
Author

(Test failures are also happening on upstream.)

@tgross35 tgross35 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants