aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-06-08 22:04:38 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit2f2555bb21dc0f53cf28155082a2bb0ac12c8959 (patch)
treee7c61243bfa9e93e91db244de7792197d5e47a5e /backend/ninja
parent3605255a8e6eabd20490e784f9535ee540c1d079 (diff)
Compile cmake sub project as cmake
Diffstat (limited to 'backend/ninja')
-rw-r--r--backend/ninja/Ninja.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index f5c92a4..1848e99 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -5,6 +5,7 @@
#include "../../include/Exec.hpp"
#include "../../include/PkgConfig.hpp"
#include "../../include/GlobalLib.hpp"
+#include "../../include/CmakeModule.hpp"
#include <algorithm>
using namespace std;
@@ -380,10 +381,20 @@ namespace backend
errMsg += " is an executable. Only libraries can be sub projects";
return Result<bool>::Err(errMsg);
}
-
- Result<bool> buildResult = subProject.subProject->build(*subProject.config, subProject.buildPath.c_str(), staticLinkerFlagCallbackFunc, dynamicLinkerFlagCallback, globalIncludeDirCallback);
- if(!buildResult)
- return buildResult;
+
+ if(subProject.config->shouldUseCmake())
+ {
+ CmakeModule cmakeModule;
+ Result<bool> buildResult = cmakeModule.compile(*subProject.config, subProject.buildPath, staticLinkerFlagCallbackFunc, dynamicLinkerFlagCallback, globalIncludeDirCallback);
+ if(!buildResult)
+ return buildResult;
+ }
+ else
+ {
+ Result<bool> buildResult = subProject.subProject->build(*subProject.config, subProject.buildPath.c_str(), staticLinkerFlagCallbackFunc, dynamicLinkerFlagCallback, globalIncludeDirCallback);
+ if(!buildResult)
+ return buildResult;
+ }
}
return Result<bool>::Ok(true);
}