From 1abab1fa5e25799a41a1ca76b39a31cda961e6d0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 17 Oct 2018 02:05:34 +0200 Subject: Add cflag include headers to parent project --- backend/ninja/Ninja.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'backend/ninja') diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 4202a82..5df859a 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -843,7 +843,7 @@ namespace backend } string dependencyExportIncludeDirs = customGlobalIncludeDirs; - globalIncludeDirCallback = [&parentGlobalIncludeDirCallback, &globalIncludeDirCallback, &dependencyExportIncludeDirs, &config](const string &globalIncludeDir) + globalIncludeDirCallback = [&parentGlobalIncludeDirCallback, &dependencyExportIncludeDirs, &config](const string &globalIncludeDir) { dependencyExportIncludeDirs += " "; dependencyExportIncludeDirs += getIncludeOptionFlag(config.getCompiler(), globalIncludeDir); @@ -913,6 +913,15 @@ namespace backend allLinkerFlags += *it; } + if(parentGlobalIncludeDirCallback) + { + vector cflagIncludes = extractIncludesFromCFlags(config.getCompiler(), cflags); + for(const ninja::NinjaArg &include : cflagIncludes) + { + parentGlobalIncludeDirCallback(include.arg); + } + } + globalIncDir += dependencyExportIncludeDirs; globalIncDir += " " + getIncludeOptionFlag(config.getCompiler(), toUtf8(generatedHeadersDir)); ninjaBuildFile.defineGlobalVariable("globalIncDir", globalIncDir); -- cgit v1.2.3