-
Notifications
You must be signed in to change notification settings - Fork 6
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
cmake: Use proper build configuration during compiler/linker flag tests #285
Conversation
Lol. See comment here: #282 (comment) I just came to the exact same conclusion :) |
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.
utACK other than the doc request.
@@ -74,6 +74,7 @@ function(set_default_config config) | |||
if(is_multi_config) | |||
get_property(help_string CACHE CMAKE_CONFIGURATION_TYPES PROPERTY HELPSTRING) | |||
set(CMAKE_CONFIGURATION_TYPES "${all_configs}" CACHE STRING "${help_string}" FORCE) | |||
set(CMAKE_TRY_COMPILE_CONFIGURATION "${config}" PARENT_SCOPE) |
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.
Could you add a link to this here? This is arguably a bug that will likely be fixed in the future.
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! Done.
ACK 60d061a Before PR with single config generators different flags were passed to It is worth noting that there is an (unavoidable?) subtle difference now between single config generator and multi config generators in that single config generators will align |
Rebased due to the recent sync/rebase cycle. |
reACK e51c781 |
Agree this is annoying, but it's unfortunately just how CMake works. The lead dev says as much in the issue linked above. Ideally multi-config would do checks for each type (and even more ideally, in parallel), but this is just how it is for now I'm afraid. |
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.
utACK. I haven't tested, but this is what I expected.
This PR makes all compiler/linker flag tests use the following build configuration:
CMAKE_BUILD_TYPE
with single-config generator, which means the same configuration during tests and the build.Addresses the issue raised during today's CMake-WG call.