From e8afe1630280335e5c7f4938f7c265b8798049d1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 1 Jan 2018 10:29:01 +0100 Subject: Use correct directory for tests depending on optimization level --- backend/ninja/Ninja.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 63624a9..4eecd6d 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -854,12 +854,21 @@ namespace backend if(!ninja.getSourceFiles().empty()) { - FileString debugBuildPath = testSourceDirNative + TINYDIR_STRING("/sibs-build/debug"); - Result buildFileResult = ninja.build(sibsTestConfig, debugBuildPath.c_str()); + FileString buildPath = testSourceDirNative; + switch(sibsTestConfig.getOptimizationLevel()) + { + case OPT_LEV_DEBUG: + buildPath += TINYDIR_STRING("/sibs-build/debug"); + break; + case OPT_LEV_RELEASE: + buildPath += TINYDIR_STRING("/sibs-build/release"); + break; + } + Result buildFileResult = ninja.build(sibsTestConfig, buildPath.c_str()); if (!buildFileResult) return buildFileResult; - Result buildResult = ninja.compile(debugBuildPath.c_str()); + Result buildResult = ninja.compile(buildPath.c_str()); if (!buildResult) return buildResult; } -- cgit v1.2.3