-
Notifications
You must be signed in to change notification settings - Fork 31
Description
When the user selects a compiler+flags combination that is insufficient to build the project, they're left with a build error that provides no hint that the compiler+flags combination is the problem. This frequently comes up when a user doesn't use -DCMAKE_CXX_STANDARD when invoking CMake. See #38 and bemanproject/inplace_vector#6 for examples of this.
@ComicSansMS and @DeveloperPaul123 suggested using cmake-compile-features with language standard arguments, but this has the side-effect of modifying the compiler flags selected by the user running CMake which can create incompatibilities.
This task is to incorporate a try_compile in CMakeLists.txt that attempts to compile a C++ file with the required language features. If it fails, a CMake-time error can be emitted that suggests the user use -DCMAKE_CXX_STANDARD. For beman.example, try_compile will verify namespace foo::bar compatibility.
See #38 (comment) and bemanproject/inplace_vector#6 (comment) for some discussions on this.