b2 icon indicating copy to clipboard operation
b2 copied to clipboard

compileflags and cflags disaster

Open Kojoley opened this issue 4 years ago • 0 comments

compileflags is documented but ignored by every toolset except cray https://github.com/bfgroup/b2/blob/f10c1d267bbddbf289c23d4955c70e1a2d2710eb/src/tools/features/compileflags-feature.jam#L10-L13

cflags is documented and implemented in different places differently

https://github.com/bfgroup/b2/blob/f10c1d267bbddbf289c23d4955c70e1a2d2710eb/src/tools/features/cflags-feature.jam#L10-L15

https://github.com/bfgroup/b2/blob/f10c1d267bbddbf289c23d4955c70e1a2d2710eb/src/tools/gcc.jam#L43-L45

and while in GCC it is documented to only apply to C sources it also applies to C++ sources, see also https://github.com/boostorg/build/issues/548

When cflags applies to C++ sources too there is no way to require some flags only for C sources. I don't know which solution is better but at least it should be consistent, and some sort of C-only flags feature is needed. Either cflags becomes C-only and cfamilyflags is added if needed, or cflags is consistently becomes C and C++ flags and conlyflags is added to solve C-only flags need.

Kojoley avatar Dec 16 '21 17:12 Kojoley