autorecipes icon indicating copy to clipboard operation
autorecipes copied to clipboard

How should `[INTERFACE_]{C,CXX}_STANDARD` and `[INTERFACE_]{C,CXX}_EXTENSIONS` affect `cflags` and `cxxflags`?

Open thejohnfreeman opened this issue 6 years ago • 4 comments

Does CMake compute the mapping and fill in [INTERFACE_]COMPILE_OPTIONS for us, or do we have to re-implement that functionality?

thejohnfreeman avatar Jun 27 '19 14:06 thejohnfreeman

Conan should probably not pull it up into the flags (if anything at all). The idea is that it's hard to reason about a global flag string if all subprojects fight for the right to control it. And with the user too! It complicates the process of forming and checking the valid flag string for the whole DAG. Projects should instead operate on the input flag string and explicitly fail if there are incompatibilities.

Minimonium avatar Jun 27 '19 16:06 Minimonium

@Minimonium does Conan have a way to model "minimum C++ standard" in cpp_info or elsewhere? Will it (i.e. is there an open issue)?

thejohnfreeman avatar Jun 27 '19 16:06 thejohnfreeman

It can check for 'compiler.cppstd' (or something along the lines) in the recipe' configure function. The standard is part of the ABI so it's modelled in the settings. Recipes should raise an error if that value is incompatible. I think the autorecipes project can generate something along the lines, but parsing all the ways the standard can br defined in cmake is a bit messy.

Minimonium avatar Jun 27 '19 17:06 Minimonium

Ok, I think it should make a best-effort check, then.

thejohnfreeman avatar Jun 27 '19 18:06 thejohnfreeman