From d376b476b15359df460977a3e64c58811fab2c91 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 1 Feb 2018 20:55:15 +0100 Subject: Add parent project expose include dir to tests --- backend/ninja/Ninja.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'backend/ninja') 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 -- cgit v1.2.3