aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-02-01 20:55:15 +0100
committerdec05eba <dec05eba@protonmail.com>2018-02-01 20:55:20 +0100
commitd376b476b15359df460977a3e64c58811fab2c91 (patch)
tree237373513633755e5ad19aab4b2b7f77ae435b40 /backend
parent18e90244d305faeb5560c02d6f0b9e848830ecc7 (diff)
Add parent project expose include dir to tests
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 9714f1d..ead91a7 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -901,6 +901,18 @@ namespace backend
parentProjConfigLib.define("wmain", "sibs_lib_ignore_wmain");
return build(parentProjConfigLib, savePath, nullptr, nullptr);
}
+
+ string parentProjectPathUtf8 = toUtf8(config.getProjectPath());
+ string parentExportIncludeDirs = parentDependencyExportIncludeDirs;
+ for (const string &parentGlobalIncludeDir : config.getGlobalIncludeDirs())
+ {
+ string parentExportIncludeDir = parentProjectPathUtf8;
+ parentExportIncludeDir += "/";
+ parentExportIncludeDir += parentGlobalIncludeDir;
+
+ parentExportIncludeDirs += " ";
+ parentExportIncludeDirs += getIncludeOptionFlag(config.getCompiler(), parentExportIncludeDir);
+ }
for(const string &testSourceDir : testSourceDirs)
{
@@ -923,7 +935,7 @@ namespace backend
}
backend::Ninja ninja;
- ninja.addGlobalIncludeDirs(parentDependencyExportIncludeDirs);
+ ninja.addGlobalIncludeDirs(parentExportIncludeDirs);
if(!projectGeneratedBinary.empty())
ninja.addDependency(projectGeneratedBinary);
// TODO: Use same source file finder as in main.cpp