ENH: add support for static library property STATIC_LIBRARY_FLAGS
This commit is contained in:
parent
8ba5612136
commit
7b576866b7
|
@ -1355,7 +1355,7 @@ void cmLocalUnixMakefileGenerator::OutputStaticLibraryRule(std::ostream& fout,
|
||||||
createRule = "CMAKE_C_CREATE_STATIC_LIBRARY";
|
createRule = "CMAKE_C_CREATE_STATIC_LIBRARY";
|
||||||
}
|
}
|
||||||
std::string linkFlags;
|
std::string linkFlags;
|
||||||
const char* targetLinkFlags = t.GetProperty("LINK_FLAGS");
|
const char* targetLinkFlags = t.GetProperty("STATIC_LIBRARY_FLAGS");
|
||||||
if(targetLinkFlags)
|
if(targetLinkFlags)
|
||||||
{
|
{
|
||||||
linkFlags += targetLinkFlags;
|
linkFlags += targetLinkFlags;
|
||||||
|
|
|
@ -979,6 +979,14 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
|
||||||
{
|
{
|
||||||
cmSystemTools::Error("Error Reading ", m_DSPHeaderTemplate.c_str());
|
cmSystemTools::Error("Error Reading ", m_DSPHeaderTemplate.c_str());
|
||||||
}
|
}
|
||||||
|
std::string staticLibOptions;
|
||||||
|
if(target.GetType() == cmTarget::STATIC_LIBRARY )
|
||||||
|
{
|
||||||
|
if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
|
||||||
|
{
|
||||||
|
staticLibOptions = libflags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string line;
|
std::string line;
|
||||||
while(cmSystemTools::GetLineFromStream(fin, line))
|
while(cmSystemTools::GetLineFromStream(fin, line))
|
||||||
|
@ -992,7 +1000,11 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha
|
||||||
customRuleCode.c_str());
|
customRuleCode.c_str());
|
||||||
cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG",
|
cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG",
|
||||||
mfcFlag);
|
mfcFlag);
|
||||||
|
if(target.GetType() == cmTarget::STATIC_LIBRARY )
|
||||||
|
{
|
||||||
|
cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS",
|
||||||
|
staticLibOptions.c_str());
|
||||||
|
}
|
||||||
cmSystemTools::ReplaceString(line, "CM_LIBRARIES",
|
cmSystemTools::ReplaceString(line, "CM_LIBRARIES",
|
||||||
libOptions.c_str());
|
libOptions.c_str());
|
||||||
cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES",
|
cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES",
|
||||||
|
|
|
@ -534,8 +534,12 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
|
||||||
std::string libpath = m_LibraryOutputPath +
|
std::string libpath = m_LibraryOutputPath +
|
||||||
"$(OutDir)/" + libName + debugPostfix + ".lib";
|
"$(OutDir)/" + libName + debugPostfix + ".lib";
|
||||||
fout << "\t\t\t<Tool\n"
|
fout << "\t\t\t<Tool\n"
|
||||||
<< "\t\t\t\tName=\"VCLibrarianTool\"\n"
|
<< "\t\t\t\tName=\"VCLibrarianTool\"\n";
|
||||||
<< "\t\t\t\t\tOutputFile=\""
|
if(const char* libflags = target.GetProperty("STATIC_LIBRARY_FLAGS"))
|
||||||
|
{
|
||||||
|
fout << "\t\t\t\tAdditionalOptions=\"" << libflags << "\"\n";
|
||||||
|
}
|
||||||
|
fout << "\t\t\t\tOutputFile=\""
|
||||||
<< this->ConvertToXMLOutputPathSingle(libpath.c_str()) << ".\"/>\n";
|
<< this->ConvertToXMLOutputPathSingle(libpath.c_str()) << ".\"/>\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=link.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo CM_STATIC_LIB_ARGS
|
||||||
|
|
||||||
CMAKE_CUSTOM_RULE_CODE
|
CMAKE_CUSTOM_RULE_CODE
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=link.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo /out:"LIBRARY_OUTPUT_PATHDebug\OUTPUT_LIBNAMEDEBUG_POSTFIX.lib"
|
# ADD LIB32 /nologo CM_STATIC_LIB_ARGS /out:"LIBRARY_OUTPUT_PATHDebug\OUTPUT_LIBNAMEDEBUG_POSTFIX.lib"
|
||||||
|
|
||||||
CMAKE_CUSTOM_RULE_CODE
|
CMAKE_CUSTOM_RULE_CODE
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=link.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo CM_STATIC_LIB_ARGS
|
||||||
|
|
||||||
CMAKE_CUSTOM_RULE_CODE
|
CMAKE_CUSTOM_RULE_CODE
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LIB32=link.exe -lib
|
LIB32=link.exe -lib
|
||||||
# ADD BASE LIB32 /nologo
|
# ADD BASE LIB32 /nologo
|
||||||
# ADD LIB32 /nologo
|
# ADD LIB32 /nologo CM_STATIC_LIB_ARGS
|
||||||
|
|
||||||
CMAKE_CUSTOM_RULE_CODE
|
CMAKE_CUSTOM_RULE_CODE
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue