Closed kietavainen closed 1 week ago
Previously, the standard was set with -std=c++17
flag, except on Cygwin where -std=gnu++17
was used. I wasn't sure if this was really intentional, so I preserved the earlier behavior. CMake enables compiler extensions by default, so by removing the CMAKE_CXX_EXTENSIONS
settings, it would use -std=gnu++17
on all platforms. Please let me know if that would be acceptable, and I can update the PR.
@felixschurk what do you think? This flag was also set, but just for CI, in 01ced3238e87b71647fcdf8179907524e97ff54a.
I think that's the better solution which also enables to easily upgrade the standard in one place in the future.
We can then remove the flag introduced in 01ced32.
In regards to the difference with cygwin, I unfortunately have no clue.
Great! I'll revert that commit then.
In regards to the difference with cygwin, I unfortunately have no clue.
I think WSL is much more common these days, so maybe this doesn't matter?
Instead of setting
-std
compiler flag directly, set theCMAKE_CXX_STANDARD
variable. This lets CMake know the required C++ standard and evaluate the final compiler flag correctly, taking into account compile features set bytarget_compile_features()
.This change preserves the existing behavior, where compiler extensions are disabled for other targets than Cygwin.
Fixes #3687.