diff --git a/Source/cmDSPMakefile.cxx b/Source/cmDSPMakefile.cxx index 7fc01edbb..87ee5c396 100644 --- a/Source/cmDSPMakefile.cxx +++ b/Source/cmDSPMakefile.cxx @@ -17,6 +17,7 @@ #include "cmStandardIncludes.h" #include "cmSystemTools.h" #include "cmRegularExpression.h" +#include "cmCacheManager.h" cmDSPMakefile::~cmDSPMakefile() { @@ -81,13 +82,27 @@ void cmDSPMakefile::OutputDSPFile() // add any extra define flags m_ReleaseLibraryOptions = m_DebugLibraryOptions; cmSystemTools::ReplaceString(m_ReleaseLibraryOptions, "Debug", "Release"); - - + m_DebugDLLLibraryOptions = m_DebugLibraryOptions; + cmSystemTools::ReplaceString(m_DebugDLLLibraryOptions, "Debug", "DebugDLL"); + m_ReleaseDLLLibraryOptions = m_DebugDLLLibraryOptions; + cmSystemTools::ReplaceString(m_ReleaseDLLLibraryOptions, "Debug", "Release"); + m_ReleaseMinSizeLibraryOptions = m_ReleaseLibraryOptions; + cmSystemTools::ReplaceString(m_ReleaseMinSizeLibraryOptions, + "Release", "ReleaseMinSize"); // Create the DSP or set of DSP's for libraries and executables if(strlen(m_Makefile->GetLibraryName()) != 0) { - this->SetBuildType(STATIC_LIBRARY); + const char* cacheValue + = cmCacheManager::GetInstance()->GetCacheValue("BUILD_SHARED_LIBS"); + if(cacheValue && strcmp(cacheValue,"0")) + { + this->SetBuildType(DLL); + } + else + { + this->SetBuildType(STATIC_LIBRARY); + } this->CreateSingleDSP(); } // if there are executables build them @@ -305,8 +320,14 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout) std::string line = buffer; cmSystemTools::ReplaceString(line, "CM_RELEASE_LIBRARIES", m_ReleaseLibraryOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_RELEASEMINSIZE_LIBRARIES", + m_ReleaseMinSizeLibraryOptions.c_str()); cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES", m_DebugLibraryOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_RELEASEDLL_LIBRARIES", + m_ReleaseDLLLibraryOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_DEBUGDLL_LIBRARIES", + m_DebugDLLLibraryOptions.c_str()); cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", m_IncludeOptions.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME", @@ -357,8 +378,7 @@ void cmDSPMakefile::WriteDSPBuildRules(std::ostream& fout, const char *ext) std::vector& Classes = m_Makefile->GetClasses(); for(int i = 0; i < Classes.size(); ++i) { - if(!Classes[i].m_IsExecutable && !Classes[i].m_AbstractClass && - !Classes[i].m_HeaderFileOnly) + if(!Classes[i].m_IsExecutable && !Classes[i].m_HeaderFileOnly) { // is this class of the appropriate type ? if (std::find(exts.begin(),exts.end(),Classes[i].m_ClassExtension) diff --git a/Source/cmDSPMakefile.h b/Source/cmDSPMakefile.h index d9bb46d67..3ed0a42f2 100644 --- a/Source/cmDSPMakefile.h +++ b/Source/cmDSPMakefile.h @@ -82,6 +82,9 @@ private: std::string m_IncludeOptions; std::string m_DebugLibraryOptions; std::string m_ReleaseLibraryOptions; + std::string m_ReleaseMinSizeLibraryOptions; + std::string m_DebugDLLLibraryOptions; + std::string m_ReleaseDLLLibraryOptions; cmMakefile* m_Makefile; std::vector m_Configurations; diff --git a/Source/cmDSPWriter.cxx b/Source/cmDSPWriter.cxx index 7fc01edbb..87ee5c396 100644 --- a/Source/cmDSPWriter.cxx +++ b/Source/cmDSPWriter.cxx @@ -17,6 +17,7 @@ #include "cmStandardIncludes.h" #include "cmSystemTools.h" #include "cmRegularExpression.h" +#include "cmCacheManager.h" cmDSPMakefile::~cmDSPMakefile() { @@ -81,13 +82,27 @@ void cmDSPMakefile::OutputDSPFile() // add any extra define flags m_ReleaseLibraryOptions = m_DebugLibraryOptions; cmSystemTools::ReplaceString(m_ReleaseLibraryOptions, "Debug", "Release"); - - + m_DebugDLLLibraryOptions = m_DebugLibraryOptions; + cmSystemTools::ReplaceString(m_DebugDLLLibraryOptions, "Debug", "DebugDLL"); + m_ReleaseDLLLibraryOptions = m_DebugDLLLibraryOptions; + cmSystemTools::ReplaceString(m_ReleaseDLLLibraryOptions, "Debug", "Release"); + m_ReleaseMinSizeLibraryOptions = m_ReleaseLibraryOptions; + cmSystemTools::ReplaceString(m_ReleaseMinSizeLibraryOptions, + "Release", "ReleaseMinSize"); // Create the DSP or set of DSP's for libraries and executables if(strlen(m_Makefile->GetLibraryName()) != 0) { - this->SetBuildType(STATIC_LIBRARY); + const char* cacheValue + = cmCacheManager::GetInstance()->GetCacheValue("BUILD_SHARED_LIBS"); + if(cacheValue && strcmp(cacheValue,"0")) + { + this->SetBuildType(DLL); + } + else + { + this->SetBuildType(STATIC_LIBRARY); + } this->CreateSingleDSP(); } // if there are executables build them @@ -305,8 +320,14 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout) std::string line = buffer; cmSystemTools::ReplaceString(line, "CM_RELEASE_LIBRARIES", m_ReleaseLibraryOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_RELEASEMINSIZE_LIBRARIES", + m_ReleaseMinSizeLibraryOptions.c_str()); cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES", m_DebugLibraryOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_RELEASEDLL_LIBRARIES", + m_ReleaseDLLLibraryOptions.c_str()); + cmSystemTools::ReplaceString(line, "CM_DEBUGDLL_LIBRARIES", + m_DebugDLLLibraryOptions.c_str()); cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", m_IncludeOptions.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME", @@ -357,8 +378,7 @@ void cmDSPMakefile::WriteDSPBuildRules(std::ostream& fout, const char *ext) std::vector& Classes = m_Makefile->GetClasses(); for(int i = 0; i < Classes.size(); ++i) { - if(!Classes[i].m_IsExecutable && !Classes[i].m_AbstractClass && - !Classes[i].m_HeaderFileOnly) + if(!Classes[i].m_IsExecutable && !Classes[i].m_HeaderFileOnly) { // is this class of the appropriate type ? if (std::find(exts.begin(),exts.end(),Classes[i].m_ClassExtension) diff --git a/Source/cmDSPWriter.h b/Source/cmDSPWriter.h index d9bb46d67..3ed0a42f2 100644 --- a/Source/cmDSPWriter.h +++ b/Source/cmDSPWriter.h @@ -82,6 +82,9 @@ private: std::string m_IncludeOptions; std::string m_DebugLibraryOptions; std::string m_ReleaseLibraryOptions; + std::string m_ReleaseMinSizeLibraryOptions; + std::string m_DebugDLLLibraryOptions; + std::string m_ReleaseDLLLibraryOptions; cmMakefile* m_Makefile; std::vector m_Configurations; diff --git a/Source/cmDSWMakefile.cxx b/Source/cmDSWMakefile.cxx index 991bac136..19fe27f92 100644 --- a/Source/cmDSWMakefile.cxx +++ b/Source/cmDSWMakefile.cxx @@ -121,20 +121,18 @@ void cmDSWMakefile::WriteProject(std::ostream& fout, fout << "Package=<5>\n{{{\n}}}\n\n"; fout << "Package=<4>\n"; fout << "{{{\n"; - if(project->GetMakefile()->HasExecutables()) + + // insert Begin Project Dependency Project_Dep_Name project stuff here + std::vector::iterator i, end; + i = project->GetMakefile()->GetLinkLibraries().begin(); + end = project->GetMakefile()->GetLinkLibraries().end(); + for(;i!= end; ++i) { - // insert Begin Project Dependency Project_Dep_Name project stuff here - std::vector::iterator i, end; - i = project->GetMakefile()->GetLinkLibraries().begin(); - end = project->GetMakefile()->GetLinkLibraries().end(); - for(;i!= end; ++i) + if (strcmp(i->c_str(),dspname)) { - if (strcmp(i->c_str(),dspname)) - { - fout << "Begin Project Dependency\n"; - fout << "Project_Dep_Name " << *i << "\n"; - fout << "End Project Dependency\n"; - } + fout << "Begin Project Dependency\n"; + fout << "Project_Dep_Name " << *i << "\n"; + fout << "End Project Dependency\n"; } } fout << "}}}\n\n"; diff --git a/Source/cmDSWWriter.cxx b/Source/cmDSWWriter.cxx index 991bac136..19fe27f92 100644 --- a/Source/cmDSWWriter.cxx +++ b/Source/cmDSWWriter.cxx @@ -121,20 +121,18 @@ void cmDSWMakefile::WriteProject(std::ostream& fout, fout << "Package=<5>\n{{{\n}}}\n\n"; fout << "Package=<4>\n"; fout << "{{{\n"; - if(project->GetMakefile()->HasExecutables()) + + // insert Begin Project Dependency Project_Dep_Name project stuff here + std::vector::iterator i, end; + i = project->GetMakefile()->GetLinkLibraries().begin(); + end = project->GetMakefile()->GetLinkLibraries().end(); + for(;i!= end; ++i) { - // insert Begin Project Dependency Project_Dep_Name project stuff here - std::vector::iterator i, end; - i = project->GetMakefile()->GetLinkLibraries().begin(); - end = project->GetMakefile()->GetLinkLibraries().end(); - for(;i!= end; ++i) + if (strcmp(i->c_str(),dspname)) { - if (strcmp(i->c_str(),dspname)) - { - fout << "Begin Project Dependency\n"; - fout << "Project_Dep_Name " << *i << "\n"; - fout << "End Project Dependency\n"; - } + fout << "Begin Project Dependency\n"; + fout << "Project_Dep_Name " << *i << "\n"; + fout << "End Project Dependency\n"; } } fout << "}}}\n\n";