VS: Allow /Fa to set AssemblerListingLocation (#14153)
Generate the default AssemblerListingLocation through the flag map so that it can be overridden by a user /Fa flag. Also teach the VS 7-9 generators to map /Fa to AssemblerListingLocation. While at it, fix the AssemblerListingLocation default value to have a trailing slash after the configuration name. This ensures it will be treated as a directory and not a file name.
This commit is contained in:
parent
edeabd18e6
commit
7e0c45e9cf
|
@ -476,6 +476,9 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
|
||||||
{"ForcedIncludeFiles", "FI", "Forced include files", "",
|
{"ForcedIncludeFiles", "FI", "Forced include files", "",
|
||||||
cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SemicolonAppendable},
|
cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SemicolonAppendable},
|
||||||
|
|
||||||
|
{"AssemblerListingLocation", "Fa", "ASM List Location", "",
|
||||||
|
cmVS7FlagTable::UserValue},
|
||||||
|
|
||||||
// boolean flags
|
// boolean flags
|
||||||
{"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0},
|
{"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0},
|
||||||
{"BufferSecurityCheck", "GS-", "Turn off Buffer security check", "FALSE", 0},
|
{"BufferSecurityCheck", "GS-", "Turn off Buffer security check", "FALSE", 0},
|
||||||
|
@ -740,6 +743,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||||
table,
|
table,
|
||||||
this->ExtraFlagTable);
|
this->ExtraFlagTable);
|
||||||
targetOptions.FixExceptionHandlingDefault();
|
targetOptions.FixExceptionHandlingDefault();
|
||||||
|
std::string asmLocation = std::string(configName) + "/";
|
||||||
|
targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
|
||||||
targetOptions.Parse(flags.c_str());
|
targetOptions.Parse(flags.c_str());
|
||||||
targetOptions.Parse(defineFlags.c_str());
|
targetOptions.Parse(defineFlags.c_str());
|
||||||
targetOptions.ParseFinish();
|
targetOptions.ParseFinish();
|
||||||
|
@ -836,7 +841,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||||
fout << "\"\n";
|
fout << "\"\n";
|
||||||
targetOptions.OutputFlagMap(fout, "\t\t\t\t");
|
targetOptions.OutputFlagMap(fout, "\t\t\t\t");
|
||||||
targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
|
targetOptions.OutputPreprocessorDefinitions(fout, "\t\t\t\t", "\n", "CXX");
|
||||||
fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
|
|
||||||
fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
|
fout << "\t\t\t\tObjectFile=\"$(IntDir)\\\"\n";
|
||||||
fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool
|
fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool
|
||||||
tool = "VCCustomBuildTool";
|
tool = "VCCustomBuildTool";
|
||||||
|
|
|
@ -1218,6 +1218,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
|
||||||
std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags();
|
std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags();
|
||||||
clOptions.FixExceptionHandlingDefault();
|
clOptions.FixExceptionHandlingDefault();
|
||||||
clOptions.AddFlag("PrecompiledHeader", "NotUsing");
|
clOptions.AddFlag("PrecompiledHeader", "NotUsing");
|
||||||
|
std::string asmLocation = configName + "/";
|
||||||
|
clOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
|
||||||
clOptions.Parse(flags.c_str());
|
clOptions.Parse(flags.c_str());
|
||||||
clOptions.Parse(defineFlags.c_str());
|
clOptions.Parse(defineFlags.c_str());
|
||||||
clOptions.AddDefines(this->Target->GetCompileDefinitions(
|
clOptions.AddDefines(this->Target->GetCompileDefinitions(
|
||||||
|
@ -1260,9 +1262,6 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
|
||||||
|
|
||||||
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
|
clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
|
||||||
"\n", "CXX");
|
"\n", "CXX");
|
||||||
this->WriteString("<AssemblerListingLocation>", 3);
|
|
||||||
*this->BuildFileStream << configName
|
|
||||||
<< "</AssemblerListingLocation>\n";
|
|
||||||
this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
|
this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
|
||||||
this->WriteString("</ClCompile>\n", 2);
|
this->WriteString("</ClCompile>\n", 2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue