Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileflags and cflags disaster #118

Open
Kojoley opened this issue Dec 16, 2021 · 0 comments
Open

compileflags and cflags disaster #118

Kojoley opened this issue Dec 16, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Kojoley
Copy link
Contributor

Kojoley commented Dec 16, 2021

compileflags is documented but ignored by every toolset except cray

[[bbv2.builtin.features.compileflags]]`compileflags`::
The value of this feature is passed without modification to the corresponding
tools. The values from the `compileflags` is applied to all compilation of any
language for the tools.

cflags is documented and implemented in different places differently

[[bbv2.builtin.features.cflags]]`cflags`; `cxxflags`; `linkflags`::
The value of these features is passed without modification to the corresponding
tools. For `cflags` that is both the C and {CPP} compilers, for `cxxflags` that
is the {CPP} compiler, and for `linkflags` that is the linker. The features are
handy when you are trying to do something special that cannot be achieved by a
higher-level feature in B2.

b2/src/tools/gcc.jam

Lines 43 to 45 in f10c1d2

`cflags`::
Specifies additional compiler flags that will be used when compiling C
sources.

and while in GCC it is documented to only apply to C sources it also applies to C++ sources, see also boostorg/build#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 Kojoley added the bug Something isn't working label Dec 16, 2021
pdimov added a commit to pdimov/bfgroup-b2 that referenced this issue Feb 11, 2022
pdimov added a commit to pdimov/bfgroup-b2 that referenced this issue Feb 13, 2022
grafikrobot pushed a commit that referenced this issue Feb 14, 2022
psandana pushed a commit to psandana/b2 that referenced this issue Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant