matheusgomes28/base64pp

Fix the inheritance of CMAKE_CXX_FLAGS in CMakePresets.json

matheusgomes28 opened this issue · 0 comments

As I casually looked at the presets, I realised that the union of the CMAKE_CXX_FLAGS never happens between presets and their parent's variables.

I have no idea what happens if two preset parents (like unix-shared and unix-rel) define the same variable, but it definitely does not unify them.

Perhaps use something like the CXX_FLAGS_INIT in one parent, and the normal CXX_FLAGS in the other, that way they will combine at configuration time, to produce the intended flags. For example, the unix-shared-rel should have flags -fPIC as well as -O3 ... .