mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
VS: Place source-specific AdditionalOptions after target-wide flags
Flags specified in the `COMPILE_FLAGS` source-file property should be placed after those in target-wide properties so that those on individual source files can override those on the whole target. This is already done by most generators but was not implemented correctly for VS 2010 and above. Closes: #16400
This commit is contained in:
9
Help/release/dev/vs-flag-order.rst
Normal file
9
Help/release/dev/vs-flag-order.rst
Normal file
@@ -0,0 +1,9 @@
|
||||
vs-flag-order
|
||||
-------------
|
||||
|
||||
* The :ref:`Visual Studio Generators` for VS 2010 and above now place
|
||||
per-source file flags after target-wide flags when they are classified
|
||||
as raw flags with no project file setting (``AdditionalOptions``).
|
||||
This behavior is more consistent with the ordering of flags produced
|
||||
by other generators, and allows flags on more-specific properties
|
||||
(per-source) to override those on more general ones (per-target).
|
||||
@@ -334,8 +334,9 @@ void cmVisualStudioGeneratorOptions::OutputAdditionalOptions(
|
||||
} else {
|
||||
fout << "<AdditionalOptions>";
|
||||
}
|
||||
fout << cmVisualStudio10GeneratorOptionsEscapeForXML(this->FlagString)
|
||||
<< " %(AdditionalOptions)</AdditionalOptions>\n";
|
||||
fout << "%(AdditionalOptions) "
|
||||
<< cmVisualStudio10GeneratorOptionsEscapeForXML(this->FlagString)
|
||||
<< "</AdditionalOptions>\n";
|
||||
} else {
|
||||
fout << prefix << "AdditionalOptions=\"";
|
||||
fout << cmVisualStudioGeneratorOptionsEscapeForXML(this->FlagString);
|
||||
|
||||
Reference in New Issue
Block a user