autotidy icon indicating copy to clipboard operation
autotidy copied to clipboard

Add `target_compile_feature` command to `CMakeLists.txt`

Open ghost opened this issue 5 years ago • 3 comments

This commands pass required C++14 standard flag to compiler.

ghost avatar May 03 '19 20:05 ghost

C++14 is set using a global property at the top of the CMakeLists.txt so I don't see a need for it to be set for each target ?

sasq64 avatar May 04 '19 07:05 sasq64

The target_compile_features pass -std=c++14 to compiler.

And the doc of CXX_STANDARD_REQUIRED says:

For compilers that have no notion of a standard level, such as MSVC, this has no effect.

ghost avatar May 04 '19 09:05 ghost

Is this a real problem for MSVC ? I don't see anything in the documentation that implies CMAKE_CXX_STANDARD is weaker than target_compile_features(cxx_std_) and I prefer to apply possibly ABI breaking stuff globally.

sasq64 avatar May 04 '19 14:05 sasq64