cmCommonTargetGenerator: Adopt AppendFortranFormatFlags
Move up from cmMakefileTargetGenerator.
This commit is contained in:
parent
0b22c0b815
commit
ab8240189d
|
@ -15,6 +15,7 @@
|
||||||
#include "cmGlobalCommonGenerator.h"
|
#include "cmGlobalCommonGenerator.h"
|
||||||
#include "cmLocalCommonGenerator.h"
|
#include "cmLocalCommonGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
|
#include "cmSourceFile.h"
|
||||||
#include "cmSystemTools.h"
|
#include "cmSystemTools.h"
|
||||||
#include "cmTarget.h"
|
#include "cmTarget.h"
|
||||||
|
|
||||||
|
@ -192,3 +193,32 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
cmCommonTargetGenerator
|
||||||
|
::AppendFortranFormatFlags(std::string& flags, cmSourceFile const& source)
|
||||||
|
{
|
||||||
|
const char* srcfmt = source.GetProperty("Fortran_FORMAT");
|
||||||
|
cmLocalGenerator::FortranFormat format =
|
||||||
|
this->LocalGenerator->GetFortranFormat(srcfmt);
|
||||||
|
if(format == cmLocalGenerator::FortranFormatNone)
|
||||||
|
{
|
||||||
|
const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT");
|
||||||
|
format = this->LocalGenerator->GetFortranFormat(tgtfmt);
|
||||||
|
}
|
||||||
|
const char* var = 0;
|
||||||
|
switch (format)
|
||||||
|
{
|
||||||
|
case cmLocalGenerator::FortranFormatFixed:
|
||||||
|
var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; break;
|
||||||
|
case cmLocalGenerator::FortranFormatFree:
|
||||||
|
var = "CMAKE_Fortran_FORMAT_FREE_FLAG"; break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
if(var)
|
||||||
|
{
|
||||||
|
this->LocalGenerator->AppendFlags(
|
||||||
|
flags, this->Makefile->GetDefinition(var));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ class cmGeneratorTarget;
|
||||||
class cmGlobalCommonGenerator;
|
class cmGlobalCommonGenerator;
|
||||||
class cmLocalCommonGenerator;
|
class cmLocalCommonGenerator;
|
||||||
class cmMakefile;
|
class cmMakefile;
|
||||||
|
class cmSourceFile;
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
|
|
||||||
/** \class cmCommonTargetGenerator
|
/** \class cmCommonTargetGenerator
|
||||||
|
@ -67,6 +68,9 @@ protected:
|
||||||
cmLocalGenerator::RelativeRoot relative,
|
cmLocalGenerator::RelativeRoot relative,
|
||||||
cmLocalGenerator::OutputFormat output =
|
cmLocalGenerator::OutputFormat output =
|
||||||
cmLocalGenerator::UNCHANGED);
|
cmLocalGenerator::UNCHANGED);
|
||||||
|
|
||||||
|
void AppendFortranFormatFlags(std::string& flags,
|
||||||
|
cmSourceFile const& source);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -504,35 +504,6 @@ void cmMakefileTargetGenerator
|
||||||
srcFullPath.c_str());
|
srcFullPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
void
|
|
||||||
cmMakefileTargetGenerator
|
|
||||||
::AppendFortranFormatFlags(std::string& flags, cmSourceFile const& source)
|
|
||||||
{
|
|
||||||
const char* srcfmt = source.GetProperty("Fortran_FORMAT");
|
|
||||||
cmLocalGenerator::FortranFormat format =
|
|
||||||
this->LocalGenerator->GetFortranFormat(srcfmt);
|
|
||||||
if(format == cmLocalGenerator::FortranFormatNone)
|
|
||||||
{
|
|
||||||
const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT");
|
|
||||||
format = this->LocalGenerator->GetFortranFormat(tgtfmt);
|
|
||||||
}
|
|
||||||
const char* var = 0;
|
|
||||||
switch (format)
|
|
||||||
{
|
|
||||||
case cmLocalGenerator::FortranFormatFixed:
|
|
||||||
var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; break;
|
|
||||||
case cmLocalGenerator::FortranFormatFree:
|
|
||||||
var = "CMAKE_Fortran_FORMAT_FREE_FLAG"; break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
if(var)
|
|
||||||
{
|
|
||||||
this->LocalGenerator->AppendFlags(
|
|
||||||
flags, this->Makefile->GetDefinition(var));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
cmMakefileTargetGenerator
|
cmMakefileTargetGenerator
|
||||||
|
|
|
@ -129,9 +129,6 @@ protected:
|
||||||
// Return the a string with -F flags on apple
|
// Return the a string with -F flags on apple
|
||||||
std::string GetFrameworkFlags(std::string const& l);
|
std::string GetFrameworkFlags(std::string const& l);
|
||||||
|
|
||||||
void AppendFortranFormatFlags(std::string& flags,
|
|
||||||
cmSourceFile const& source);
|
|
||||||
|
|
||||||
// append intertarget dependencies
|
// append intertarget dependencies
|
||||||
void AppendTargetDepends(std::vector<std::string>& depends);
|
void AppendTargetDepends(std::vector<std::string>& depends);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue