diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-06-08 22:04:38 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | 2f2555bb21dc0f53cf28155082a2bb0ac12c8959 (patch) | |
tree | e7c61243bfa9e93e91db244de7792197d5e47a5e /backend | |
parent | 3605255a8e6eabd20490e784f9535ee540c1d079 (diff) |
Compile cmake sub project as cmake
Diffstat (limited to 'backend')
-rw-r--r-- | backend/ninja/Ninja.cpp | 19 |
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); } |