summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-04-06 21:01:57 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-04-06 21:01:57 (GMT)
commit70b14df3f06177a1e65dfc9eb4bb4c0b0938a2a2 (patch)
treef66ae18d6744c5be0a92bda9b6e5bb69bdb51f54
parent2a7964e310d56a0e36e3c8581ca6b4904da03e41 (diff)
downloadCMake-70b14df3f06177a1e65dfc9eb4bb4c0b0938a2a2.zip
CMake-70b14df3f06177a1e65dfc9eb4bb4c0b0938a2a2.tar.gz
CMake-70b14df3f06177a1e65dfc9eb4bb4c0b0938a2a2.tar.bz2
BUG: fix depends for libraries and executables in the same dir
-rw-r--r--Source/cmDSPMakefile.cxx31
-rw-r--r--Source/cmDSPMakefile.h3
-rw-r--r--Source/cmDSPWriter.cxx31
-rw-r--r--Source/cmDSPWriter.h3
-rw-r--r--Source/cmDSWMakefile.cxx2
-rw-r--r--Source/cmDSWWriter.cxx2
6 files changed, 62 insertions, 10 deletions
diff --git a/Source/cmDSPMakefile.cxx b/Source/cmDSPMakefile.cxx
index ac0688e..0d8928c 100644
--- a/Source/cmDSPMakefile.cxx
+++ b/Source/cmDSPMakefile.cxx
@@ -73,6 +73,7 @@ void cmDSPMakefile::OutputDSPFile()
m_LibraryOptions += "/$(OUTDIR)\" ";
}
m_LibraryOptions += "/STACK:10000000 ";
+ m_OutputLibName = m_Makefile->GetLibraryName();
// Create the DSP or set of DSP's for libraries and executables
if(strlen(m_Makefile->GetLibraryName()) != 0)
@@ -115,9 +116,10 @@ void cmDSPMakefile::CreateExecutableDSPFiles()
}
else
{
- m_Makefile->SetLibraryName(classfile.m_ClassName.c_str());
+// m_Makefile->SetLibraryName(classfile.m_ClassName.c_str());
this->SetBuildType(EXECUTABLE);
- std::string pname = m_Makefile->GetLibraryName();
+ m_OutputLibName = classfile.m_ClassName;
+ std::string pname = classfile.m_ClassName.c_str(); //m_Makefile->GetLibraryName();
m_CreatedProjectNames.push_back(pname);
this->WriteDSPHeader(fout);
@@ -412,7 +414,7 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout)
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
m_IncludeOptions.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",
- m_Makefile->GetLibraryName());
+ m_OutputLibName.c_str());
cmSystemTools::ReplaceString(line,
"EXTRA_DEFINES",
m_Makefile->GetDefineFlags());
@@ -445,3 +447,26 @@ void cmDSPMakefile::WriteDSPBuildRule(std::ostream& fout, const char* path)
<< path << "\n";
fout << "# End Source File\n";
}
+
+bool cmDSPMakefile::NeedsDependencies(const char* dspname)
+{
+ if(strcmp(m_Makefile->GetLibraryName(), dspname) == 0)
+ {
+ // only shared libs need depend info
+ const char* cacheValue
+ = cmCacheManager::GetInstance()->GetCacheValue("BUILD_SHARED_LIBS");
+ if(cacheValue && strcmp(cacheValue,"0"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ // must be an executable so it needs depends
+ return true;
+}
+
+
+
diff --git a/Source/cmDSPMakefile.h b/Source/cmDSPMakefile.h
index f1a2003..9d82696 100644
--- a/Source/cmDSPMakefile.h
+++ b/Source/cmDSPMakefile.h
@@ -61,7 +61,7 @@ public:
{
return m_Makefile;
}
-
+ bool NeedsDependencies(const char* dspname);
private:
std::string m_DSPHeaderTemplate;
std::string m_DSPFooterTemplate;
@@ -86,6 +86,7 @@ private:
std::string m_IncludeOptions;
std::string m_LibraryOptions;
+ std::string m_OutputLibName;
cmMakefile* m_Makefile;
BuildType m_BuildType;
std::vector<std::string> m_Configurations;
diff --git a/Source/cmDSPWriter.cxx b/Source/cmDSPWriter.cxx
index ac0688e..0d8928c 100644
--- a/Source/cmDSPWriter.cxx
+++ b/Source/cmDSPWriter.cxx
@@ -73,6 +73,7 @@ void cmDSPMakefile::OutputDSPFile()
m_LibraryOptions += "/$(OUTDIR)\" ";
}
m_LibraryOptions += "/STACK:10000000 ";
+ m_OutputLibName = m_Makefile->GetLibraryName();
// Create the DSP or set of DSP's for libraries and executables
if(strlen(m_Makefile->GetLibraryName()) != 0)
@@ -115,9 +116,10 @@ void cmDSPMakefile::CreateExecutableDSPFiles()
}
else
{
- m_Makefile->SetLibraryName(classfile.m_ClassName.c_str());
+// m_Makefile->SetLibraryName(classfile.m_ClassName.c_str());
this->SetBuildType(EXECUTABLE);
- std::string pname = m_Makefile->GetLibraryName();
+ m_OutputLibName = classfile.m_ClassName;
+ std::string pname = classfile.m_ClassName.c_str(); //m_Makefile->GetLibraryName();
m_CreatedProjectNames.push_back(pname);
this->WriteDSPHeader(fout);
@@ -412,7 +414,7 @@ void cmDSPMakefile::WriteDSPHeader(std::ostream& fout)
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
m_IncludeOptions.c_str());
cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",
- m_Makefile->GetLibraryName());
+ m_OutputLibName.c_str());
cmSystemTools::ReplaceString(line,
"EXTRA_DEFINES",
m_Makefile->GetDefineFlags());
@@ -445,3 +447,26 @@ void cmDSPMakefile::WriteDSPBuildRule(std::ostream& fout, const char* path)
<< path << "\n";
fout << "# End Source File\n";
}
+
+bool cmDSPMakefile::NeedsDependencies(const char* dspname)
+{
+ if(strcmp(m_Makefile->GetLibraryName(), dspname) == 0)
+ {
+ // only shared libs need depend info
+ const char* cacheValue
+ = cmCacheManager::GetInstance()->GetCacheValue("BUILD_SHARED_LIBS");
+ if(cacheValue && strcmp(cacheValue,"0"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ // must be an executable so it needs depends
+ return true;
+}
+
+
+
diff --git a/Source/cmDSPWriter.h b/Source/cmDSPWriter.h
index f1a2003..9d82696 100644
--- a/Source/cmDSPWriter.h
+++ b/Source/cmDSPWriter.h
@@ -61,7 +61,7 @@ public:
{
return m_Makefile;
}
-
+ bool NeedsDependencies(const char* dspname);
private:
std::string m_DSPHeaderTemplate;
std::string m_DSPFooterTemplate;
@@ -86,6 +86,7 @@ private:
std::string m_IncludeOptions;
std::string m_LibraryOptions;
+ std::string m_OutputLibName;
cmMakefile* m_Makefile;
BuildType m_BuildType;
std::vector<std::string> m_Configurations;
diff --git a/Source/cmDSWMakefile.cxx b/Source/cmDSWMakefile.cxx
index a61e2e9..a7fb010 100644
--- a/Source/cmDSWMakefile.cxx
+++ b/Source/cmDSWMakefile.cxx
@@ -126,7 +126,7 @@ void cmDSWMakefile::WriteProject(std::ostream& fout,
std::vector<std::string>::iterator i, end;
i = project->GetMakefile()->GetLinkLibraries().begin();
end = project->GetMakefile()->GetLinkLibraries().end();
- if(project->GetBuildType() != cmDSPMakefile::STATIC_LIBRARY)
+ if(project->NeedsDependencies(dspname))
{
for(;i!= end; ++i)
{
diff --git a/Source/cmDSWWriter.cxx b/Source/cmDSWWriter.cxx
index a61e2e9..a7fb010 100644
--- a/Source/cmDSWWriter.cxx
+++ b/Source/cmDSWWriter.cxx
@@ -126,7 +126,7 @@ void cmDSWMakefile::WriteProject(std::ostream& fout,
std::vector<std::string>::iterator i, end;
i = project->GetMakefile()->GetLinkLibraries().begin();
end = project->GetMakefile()->GetLinkLibraries().end();
- if(project->GetBuildType() != cmDSPMakefile::STATIC_LIBRARY)
+ if(project->NeedsDependencies(dspname))
{
for(;i!= end; ++i)
{