diff options
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); } |