ENH: Made cmLocalVisualStudioGenerator a superclass of cmLocalVisualStudio6Generator. Implemented object file unique naming when multiple sources share the same name.
This commit is contained in:
parent
9bf5af6e32
commit
87ef95c715
|
@ -360,6 +360,9 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Compute which sources need unique object computation.
|
||||||
|
this->ComputeObjectNameRequirements(sourceGroups);
|
||||||
|
|
||||||
// Write the DSP file's header.
|
// Write the DSP file's header.
|
||||||
this->WriteDSPHeader(fout, libName, target, sourceGroups);
|
this->WriteDSPHeader(fout, libName, target, sourceGroups);
|
||||||
|
|
||||||
|
@ -404,6 +407,13 @@ void cmLocalVisualStudio6Generator
|
||||||
(*sf)->GetCustomCommand();
|
(*sf)->GetCustomCommand();
|
||||||
std::string compileFlags;
|
std::string compileFlags;
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
|
std::string objectNameDir;
|
||||||
|
if(this->NeedObjectName.find(*sf) != this->NeedObjectName.end())
|
||||||
|
{
|
||||||
|
objectNameDir =
|
||||||
|
cmSystemTools::GetFilenamePath(
|
||||||
|
this->GetObjectFileNameWithoutTarget(*(*sf)));
|
||||||
|
}
|
||||||
|
|
||||||
// Add per-source file flags.
|
// Add per-source file flags.
|
||||||
if(const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS"))
|
if(const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS"))
|
||||||
|
@ -464,7 +474,7 @@ void cmLocalVisualStudio6Generator
|
||||||
comment.c_str(), command->GetDepends(),
|
comment.c_str(), command->GetDepends(),
|
||||||
command->GetOutputs(), flags);
|
command->GetOutputs(), flags);
|
||||||
}
|
}
|
||||||
else if(compileFlags.size())
|
else if(!compileFlags.empty() || !objectNameDir.empty())
|
||||||
{
|
{
|
||||||
for(std::vector<std::string>::iterator i
|
for(std::vector<std::string>::iterator i
|
||||||
= this->Configurations.begin();
|
= this->Configurations.begin();
|
||||||
|
@ -478,8 +488,23 @@ void cmLocalVisualStudio6Generator
|
||||||
{
|
{
|
||||||
fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl;
|
fout << "!ELSEIF \"$(CFG)\" == " << i->c_str() << std::endl;
|
||||||
}
|
}
|
||||||
|
if(!compileFlags.empty())
|
||||||
|
{
|
||||||
fout << "\n# ADD CPP " << compileFlags << "\n\n";
|
fout << "\n# ADD CPP " << compileFlags << "\n\n";
|
||||||
}
|
}
|
||||||
|
if(!objectNameDir.empty())
|
||||||
|
{
|
||||||
|
// Strip the subdirectory name out of the configuration name.
|
||||||
|
std::string config = *i;
|
||||||
|
std::string::size_type pos = config.find_last_of(" ");
|
||||||
|
config = config.substr(pos+1, std::string::npos);
|
||||||
|
config = config.substr(0, config.size()-1);
|
||||||
|
|
||||||
|
// Setup an alternate object file directory.
|
||||||
|
fout << "\n# PROP Intermediate_Dir \""
|
||||||
|
<< config << "/" << objectNameDir << "\"\n\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
fout << "!ENDIF\n\n";
|
fout << "!ENDIF\n\n";
|
||||||
}
|
}
|
||||||
fout << "# End Source File\n";
|
fout << "# End Source File\n";
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#ifndef cmLocalVisualStudio6Generator_h
|
#ifndef cmLocalVisualStudio6Generator_h
|
||||||
#define cmLocalVisualStudio6Generator_h
|
#define cmLocalVisualStudio6Generator_h
|
||||||
|
|
||||||
#include "cmLocalGenerator.h"
|
#include "cmLocalVisualStudioGenerator.h"
|
||||||
|
|
||||||
class cmMakeDepend;
|
class cmMakeDepend;
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
|
@ -31,7 +31,7 @@ class cmCustomCommand;
|
||||||
* cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
|
* cmLocalVisualStudio6Generator produces a LocalUnix makefile from its
|
||||||
* member this->Makefile.
|
* member this->Makefile.
|
||||||
*/
|
*/
|
||||||
class cmLocalVisualStudio6Generator : public cmLocalGenerator
|
class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///! Set cache only and recurse to false by default.
|
///! Set cache only and recurse to false by default.
|
||||||
|
|
Loading…
Reference in New Issue