I'd like to have complete control over the command line arguments Bazel passes to the compiler when compiling and linking C++ files. For example, I'd like to use a G++ from a custom path, I'd like to change -std=c++0x to -std=c++14 and remove -fno-omit-frame-pointer - with the following constraints:
- Avoid setting the compiler via
CCenvvar, as it is fragile - Avoid using
--crosstool_topet. al, as I understand Bazel is moving away from it - Be compatible with --all_incompatible_changes
- Do not simply override those args via
copts, as it is fragile and makes error prone commands
Preferably, I'd like to get the auto detected, generated toolchain, modify it, and commit it to my workspace, to be used by every C++ target in the workspace, including imported, from source compiled workspaces.
I looked at Toolchains, Configuring C++ toolchain, rules_cc - but I couldn't figure it out.