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 :) |
| 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.
Could you add a link to this here? This is arguably a bug that will likely be fixed in the future.
|
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. |
theuni
left a comment
There was a problem hiding this comment.
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_TYPEwith single-config generator, which means the same configuration during tests and the build.Addresses the issue raised during today's CMake-WG call.