aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Conf.hpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/include/Conf.hpp b/include/Conf.hpp
index 476e38b..de63eae 100644
--- a/include/Conf.hpp
+++ b/include/Conf.hpp
@@ -169,13 +169,14 @@ namespace sibs
class SibsConfig : public ConfigCallback
{
public:
- SibsConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel = OPT_LEV_DEBUG) :
+ SibsConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel, bool _buildTests) :
compiler(_compiler),
projectPath(_projectPath),
packageType((PackageType)-1),
optimizationLevel(_optimizationLevel),
finishedProcessing(false),
- useCmake(false)
+ useCmake(false),
+ buildTests(_buildTests)
{
cmakeDirGlobal = projectPath;
cmakeDirStatic = cmakeDirGlobal;
@@ -214,6 +215,11 @@ namespace sibs
{
return testPath;
}
+
+ void setTestPath(const FileString &testPath)
+ {
+ this->testPath = testPath;
+ }
virtual const std::vector<Dependency>& getDependencies() const
{
@@ -267,12 +273,12 @@ namespace sibs
const FileString& getCmakeDirStatic() const
{
- return cmakeDirStatic;
+ return !cmakeDirStatic.empty() ? cmakeDirStatic : cmakeDirGlobal;
}
const FileString& getCmakeDirDynamic() const
{
- return cmakeDirDynamic;
+ return !cmakeDirDynamic.empty() ? cmakeDirDynamic : cmakeDirGlobal;
}
// Get cmake args for all builds. This is args under [cmake] only
@@ -308,6 +314,11 @@ namespace sibs
return useCmake;
}
+ bool shouldBuildTests() const
+ {
+ return buildTests;
+ }
+
void setPackageType(PackageType packageType)
{
this->packageType = packageType;
@@ -351,13 +362,14 @@ namespace sibs
std::string cmakeArgsStatic;
std::string cmakeArgsDynamic;
bool useCmake;
+ bool buildTests;
bool finishedProcessing;
};
class SibsTestConfig : public SibsConfig
{
public:
- SibsTestConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel) : SibsConfig(_compiler, _projectPath, _optimizationLevel)
+ SibsTestConfig(Compiler _compiler, const FileString &_projectPath, OptimizationLevel _optimizationLevel) : SibsConfig(_compiler, _projectPath, _optimizationLevel, true)
{
packageName = "test";
}