C::B: Get the Makefile from the LocalGenerator, not vice-versa.
The Makefile is a configure-time concept, and the LocalGenerator is a generate time concept. The LocalGenerator should not be available from the Makefile.
This commit is contained in:
parent
820986edff
commit
2e9333a1d0
@ -313,7 +313,7 @@ void cmExtraCodeBlocksGenerator
|
|||||||
" "<<virtualFolders<<"\n"
|
" "<<virtualFolders<<"\n"
|
||||||
" <Build>\n";
|
" <Build>\n";
|
||||||
|
|
||||||
this->AppendTarget(fout, "all", 0, make.c_str(), mf, compiler.c_str());
|
this->AppendTarget(fout, "all", 0, make.c_str(), lgs[0], compiler.c_str());
|
||||||
|
|
||||||
// add all executable and library targets and some of the GLOBAL
|
// add all executable and library targets and some of the GLOBAL
|
||||||
// and UTILITY targets
|
// and UTILITY targets
|
||||||
@ -335,7 +335,7 @@ void cmExtraCodeBlocksGenerator
|
|||||||
makefile->GetHomeOutputDirectory())==0)
|
makefile->GetHomeOutputDirectory())==0)
|
||||||
{
|
{
|
||||||
this->AppendTarget(fout, ti->first, 0,
|
this->AppendTarget(fout, ti->first, 0,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), *lg, compiler.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -351,7 +351,7 @@ void cmExtraCodeBlocksGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->AppendTarget(fout, ti->first, 0,
|
this->AppendTarget(fout, ti->first, 0,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), *lg, compiler.c_str());
|
||||||
break;
|
break;
|
||||||
case cmTarget::EXECUTABLE:
|
case cmTarget::EXECUTABLE:
|
||||||
case cmTarget::STATIC_LIBRARY:
|
case cmTarget::STATIC_LIBRARY:
|
||||||
@ -360,11 +360,11 @@ void cmExtraCodeBlocksGenerator
|
|||||||
case cmTarget::OBJECT_LIBRARY:
|
case cmTarget::OBJECT_LIBRARY:
|
||||||
{
|
{
|
||||||
this->AppendTarget(fout, ti->first, &ti->second,
|
this->AppendTarget(fout, ti->first, &ti->second,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), *lg, compiler.c_str());
|
||||||
std::string fastTarget = ti->first;
|
std::string fastTarget = ti->first;
|
||||||
fastTarget += "/fast";
|
fastTarget += "/fast";
|
||||||
this->AppendTarget(fout, fastTarget, &ti->second,
|
this->AppendTarget(fout, fastTarget, &ti->second,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), *lg, compiler.c_str());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -519,14 +519,16 @@ void cmExtraCodeBlocksGenerator
|
|||||||
|
|
||||||
// Write a dummy file for OBJECT libraries, so C::B can reference some file
|
// Write a dummy file for OBJECT libraries, so C::B can reference some file
|
||||||
std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
|
std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
|
||||||
cmMakefile* mf, cmTarget* target) const
|
cmLocalGenerator* lg,
|
||||||
|
cmTarget* target) const
|
||||||
{
|
{
|
||||||
|
cmMakefile *mf = lg->GetMakefile();
|
||||||
// this file doesn't seem to be used by C::B in custom makefile mode,
|
// 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
|
// 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.
|
// C::B uses it in some way, the targets don't interfere with each other.
|
||||||
std::string filename = mf->GetCurrentBinaryDirectory();
|
std::string filename = mf->GetCurrentBinaryDirectory();
|
||||||
filename += "/";
|
filename += "/";
|
||||||
filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
|
filename += lg->GetTargetDirectory(*target);
|
||||||
filename += "/";
|
filename += "/";
|
||||||
filename += target->GetName();
|
filename += target->GetName();
|
||||||
filename += ".objlib";
|
filename += ".objlib";
|
||||||
@ -547,9 +549,10 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
|||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
cmTarget* target,
|
cmTarget* target,
|
||||||
const char* make,
|
const char* make,
|
||||||
const cmMakefile* makefile,
|
const cmLocalGenerator* lg,
|
||||||
const char* compiler)
|
const char* compiler)
|
||||||
{
|
{
|
||||||
|
cmMakefile const* makefile = lg->GetMakefile();
|
||||||
std::string makefileName = makefile->GetCurrentBinaryDirectory();
|
std::string makefileName = makefile->GetCurrentBinaryDirectory();
|
||||||
makefileName += "/Makefile";
|
makefileName += "/Makefile";
|
||||||
|
|
||||||
@ -583,7 +586,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
|||||||
std::string location;
|
std::string location;
|
||||||
if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
|
if ( target->GetType()==cmTarget::OBJECT_LIBRARY)
|
||||||
{
|
{
|
||||||
location = this->CreateDummyTargetFile(const_cast<cmMakefile*>(makefile),
|
location = this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg),
|
||||||
target);
|
target);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -618,8 +621,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
|||||||
std::set<std::string> uniqIncludeDirs;
|
std::set<std::string> uniqIncludeDirs;
|
||||||
|
|
||||||
std::vector<std::string> includes;
|
std::vector<std::string> includes;
|
||||||
target->GetMakefile()->GetLocalGenerator()->
|
lg->GetIncludeDirectories(includes, gtgt, "C", buildType);
|
||||||
GetIncludeDirectories(includes, gtgt, "C", buildType);
|
|
||||||
|
|
||||||
uniqIncludeDirs.insert(includes.begin(), includes.end());
|
uniqIncludeDirs.insert(includes.begin(), includes.end());
|
||||||
|
|
||||||
|
@ -48,7 +48,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 CreateDummyTargetFile(cmLocalGenerator* lg,
|
||||||
|
cmTarget* target) const;
|
||||||
|
|
||||||
std::string GetCBCompilerId(const cmMakefile* mf);
|
std::string GetCBCompilerId(const cmMakefile* mf);
|
||||||
int GetCBTargetType(cmTarget* target);
|
int GetCBTargetType(cmTarget* target);
|
||||||
@ -58,7 +59,7 @@ private:
|
|||||||
const std::string& targetName,
|
const std::string& targetName,
|
||||||
cmTarget* target,
|
cmTarget* target,
|
||||||
const char* make,
|
const char* make,
|
||||||
const cmMakefile* makefile,
|
const cmLocalGenerator* lg,
|
||||||
const char* compiler);
|
const char* compiler);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user