diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-04-22 20:58:04 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-04-22 20:58:04 (GMT) |
commit | 7b576866b78ae1c6ba5dfc180d4b4f4b64f48872 (patch) | |
tree | 5d229cb06dc5183729564fd3830e01b06e60d182 | |
parent | 8ba5612136d6d37db1abec8041be9dad2b834949 (diff) | |
download | CMake-7b576866b78ae1c6ba5dfc180d4b4f4b64f48872.zip CMake-7b576866b78ae1c6ba5dfc180d4b4f4b64f48872.tar.gz CMake-7b576866b78ae1c6ba5dfc180d4b4f4b64f48872.tar.bz2 |
ENH: add support for static library property STATIC_LIBRARY_FLAGS
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 16 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 8 | ||||
-rw-r--r-- | Templates/staticLibHeader.dsptemplate | 8 |
4 files changed, 25 insertions, 9 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index d732cbf..be05453 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -1355,7 +1355,7 @@ void cmLocalUnixMakefileGenerator::OutputStaticLibraryRule(std::ostream& fout, createRule = "CMAKE_C_CREATE_STATIC_LIBRARY"; } std::string linkFlags; - const char* targetLinkFlags = t.GetProperty("LINK_FLAGS"); + const char* targetLinkFlags = t.GetProperty("STATIC_LIBRARY_FLAGS"); if(targetLinkFlags) { linkFlags += targetLinkFlags; diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 118874a..cf863a5 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -979,7 +979,15 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha { 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; while(cmSystemTools::GetLineFromStream(fin, line)) { @@ -992,7 +1000,11 @@ void cmLocalVisualStudio6Generator::WriteDSPHeader(std::ostream& fout, const cha customRuleCode.c_str()); cmSystemTools::ReplaceString(line, "CMAKE_MFC_FLAG", mfcFlag); - + if(target.GetType() == cmTarget::STATIC_LIBRARY ) + { + cmSystemTools::ReplaceString(line, "CM_STATIC_LIB_ARGS", + staticLibOptions.c_str()); + } cmSystemTools::ReplaceString(line, "CM_LIBRARIES", libOptions.c_str()); cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES", diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 29ae364..987917e 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -534,8 +534,12 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, std::string libpath = m_LibraryOutputPath + "$(OutDir)/" + libName + debugPostfix + ".lib"; fout << "\t\t\t<Tool\n" - << "\t\t\t\tName=\"VCLibrarianTool\"\n" - << "\t\t\t\t\tOutputFile=\"" + << "\t\t\t\tName=\"VCLibrarianTool\"\n"; + 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"; break; } diff --git a/Templates/staticLibHeader.dsptemplate b/Templates/staticLibHeader.dsptemplate index 39de7fc..c710106 100644 --- a/Templates/staticLibHeader.dsptemplate +++ b/Templates/staticLibHeader.dsptemplate @@ -65,7 +65,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo CM_STATIC_LIB_ARGS
CMAKE_CUSTOM_RULE_CODE
@@ -93,7 +93,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LIB32=link.exe -lib
# 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
@@ -122,7 +122,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo CM_STATIC_LIB_ARGS
CMAKE_CUSTOM_RULE_CODE
@@ -150,7 +150,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
+# ADD LIB32 /nologo CM_STATIC_LIB_ARGS
CMAKE_CUSTOM_RULE_CODE
|