From c12bc479bb1d69e8980ab3b046a53ae271b27ece Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 20 Oct 2017 17:40:55 +0200 Subject: Only add /System/Library/Frameworks to default compiler path on Darwin Change-Id: Ia9ce8fbe4120d4dac562083b7181dce98128db48 Reviewed-by: Christian Kandeler --- share/qbs/imports/qbs/Probes/GccProbe.qbs | 3 ++- share/qbs/modules/cpp/gcc.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/share/qbs/imports/qbs/Probes/GccProbe.qbs b/share/qbs/imports/qbs/Probes/GccProbe.qbs index 627f9b468..3b0902bc5 100644 --- a/share/qbs/imports/qbs/Probes/GccProbe.qbs +++ b/share/qbs/imports/qbs/Probes/GccProbe.qbs @@ -43,6 +43,7 @@ PathProbe { property string _nullDevice: qbs.nullDevice property string _pathListSeparator: qbs.pathListSeparator property string _sysroot: qbs.sysroot + property stringList _targetOS: qbs.targetOS // Outputs property string architecture @@ -84,7 +85,7 @@ PathProbe { var defaultPaths = Gcc.dumpDefaultPaths(environment, compilerFilePathByLanguage["cpp"] || compilerFilePathByLanguage["c"], flags, _nullDevice, - _pathListSeparator, _sysroot); + _pathListSeparator, _sysroot, _targetOS); found = !!macros && !!defaultPaths; includePaths = defaultPaths.includePaths; diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 2ebb00456..f638d3cb3 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -1309,7 +1309,8 @@ function dumpMacros(env, compilerFilePath, args, nullDevice, tag) { } } -function dumpDefaultPaths(env, compilerFilePath, args, nullDevice, pathListSeparator, sysroot) { +function dumpDefaultPaths(env, compilerFilePath, args, nullDevice, pathListSeparator, sysroot, + targetOS) { var p = new Process(); try { p.setEnv("LC_ALL", "C"); @@ -1349,7 +1350,7 @@ function dumpDefaultPaths(env, compilerFilePath, args, nullDevice, pathListSepar if (libraryPaths.length === 0) libraryPaths.push(sysroot + "/lib", sysroot + "/usr/lib"); - if (frameworkPaths.length === 0) + if (frameworkPaths.length === 0 && targetOS.contains("darwin")) frameworkPaths.push(sysroot + "/System/Library/Frameworks"); return { -- cgit v1.2.3