mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
fileAPI: Expose CMAKE_<LANG>_COMPILER_ARG1
Compiler arguments coming from CC environment variables or multi-element CMAKE_<LANG>_COMPILER variables set by toolchain files were previously not exposed in the file API. Among other possible problems, this caused clients to determine wrong system include paths and built-in preprocessor macros by calling the compiler without these important arguments. This is fixed by adding an optional "commandFragment" attribute to the compiler description in the `toolchains` object, containing these arguments as a command line fragment. This is already the form in which they are internally stored in the CMAKE_<LANG>_COMPILER_ARG1 variable, so all that is required is adding this variable to the set of exported variables, besides some logic to omit it if empty. Issue: #22568
This commit is contained in:
committed by
Craig Scott
parent
1e02926c9a
commit
71a4e34d97
@@ -959,7 +959,7 @@ Json::Value cmFileAPI::BuildCMakeFiles(Object object)
|
||||
|
||||
// The "toolchains" object kind.
|
||||
|
||||
static unsigned int const ToolchainsV1Minor = 0;
|
||||
static unsigned int const ToolchainsV1Minor = 1;
|
||||
|
||||
void cmFileAPI::BuildClientRequestToolchains(
|
||||
ClientRequest& r, std::vector<RequestVersion> const& versions)
|
||||
|
||||
Reference in New Issue
Block a user