CodeBlocks: improve support for OBJECT libraries
This commit creates a dummy text file for each OBJECT library for the CodeBlocks generator, so the generated project file can reference a unique file for each target. Most probably these files are unused. Alex
This commit is contained in:
parent
d2ed3c7dee
commit
38d4c1ed05
|
@ -534,6 +534,31 @@ void cmExtraCodeBlocksGenerator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Write a dummy file for OBJECT libraries, so C::B can reference some file
|
||||||
|
std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
|
||||||
|
cmMakefile* mf, cmTarget* target) const
|
||||||
|
{
|
||||||
|
// this file doesn't seem to be used by C::B in custom makefile mode,
|
||||||
|
// but we generate a unique file for each OBJECT library so in case
|
||||||
|
// C::B uses it in some way, the targets don't interfere with each other.
|
||||||
|
std::string filename = mf->GetCurrentOutputDirectory();
|
||||||
|
filename += "/";
|
||||||
|
filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
|
||||||
|
filename += "/";
|
||||||
|
filename += target->GetName();
|
||||||
|
filename += ".objlib";
|
||||||
|
cmGeneratedFileStream fout(filename.c_str());
|
||||||
|
if(fout)
|
||||||
|
{
|
||||||
|
fout << "# This is a dummy file for the OBJECT library "
|
||||||
|
<< target->GetName()
|
||||||
|
<< " for the CMake CodeBlocks project generator.\n"
|
||||||
|
<< "# Don't edit, this file will be overwritten.\n";
|
||||||
|
}
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Generate the xml code for one target.
|
// Generate the xml code for one target.
|
||||||
void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
||||||
const char* targetName,
|
const char* targetName,
|
||||||
|
@ -572,10 +597,11 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* buildType = makefile->GetDefinition("CMAKE_BUILD_TYPE");
|
const char* buildType = makefile->GetDefinition("CMAKE_BUILD_TYPE");
|
||||||
const char* location = 0;
|
std::string location;
|
||||||
if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
|
if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
|
||||||
{
|
{
|
||||||
location = "dummy"; // hmm, what to use here ?
|
location = this->CreateDummyTargetFile(const_cast<cmMakefile*>(makefile),
|
||||||
|
target);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,8 @@ private:
|
||||||
|
|
||||||
void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
|
void CreateNewProjectFile(const std::vector<cmLocalGenerator*>& lgs,
|
||||||
const std::string& filename);
|
const std::string& filename);
|
||||||
|
std::string CreateDummyTargetFile(cmMakefile* mf, cmTarget* target) const;
|
||||||
|
|
||||||
std::string GetCBCompilerId(const cmMakefile* mf);
|
std::string GetCBCompilerId(const cmMakefile* mf);
|
||||||
int GetCBTargetType(cmTarget* target);
|
int GetCBTargetType(cmTarget* target);
|
||||||
std::string BuildMakeCommand(const std::string& make, const char* makefile,
|
std::string BuildMakeCommand(const std::string& make, const char* makefile,
|
||||||
|
|
Loading…
Reference in New Issue