#include "CCSource.h" #include "FileSystemUtilities.h" #include "Project.h" #include "ToolChain.h" #include CCSource::CCSource(const std::string& aName) : Name(aName), ConsideredCompiling(false), CompiledCorrectly(false) { } CCSource::~CCSource() { } void CCSource::compilationFinished(bool Correctly) { CompiledCorrectly = Correctly; } void CCSource::setName(const std::string& N) { Name = N; } std::string CCSource::name() const { return Name; } std::string CCSource::dependencyName() const { return DependencyName; } void CCSource::setDependencyName(const std::string& n) { DependencyName = n; } std::string CCSource::sourceName() const { std::string SourceBase(configuration().sourcePath()); if (Name.find(".") == std::string::npos) return pathAppend(SourceBase,Name + ".cc"); return pathAppend(SourceBase,Name); } std::string CCSource::objectName() const { return ObjectName; } void CCSource::setObjectName(const std::string& oName) { ObjectName = oName; } bool CCSource::objectFileIsCorrect() { return CompiledCorrectly; } ProcessController* CCSource::createNextTask() { if (ConsideredCompiling) return 0; ConsideredCompiling = true; SharedPtr Current(ToolChain::createByName(configuration().toolChain())); Current->initResultNames(*this); return Current->createCompilation(*this); } GeneratedCCSource::GeneratedCCSource(SharedPtr aGen) : CCSource(""), theGenerator(aGen->copy()) { setName(theGenerator->output()); } ProcessController* GeneratedCCSource::createNextTask() { if (theGenerator->ready()) return CCSource::createNextTask(); return theGenerator->createNextTask(); }