diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-08-02 15:44:38 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-08-03 18:05:31 +0000 |
commit | 0ceafb16587384c9faf7d5892c7786acb36b824f (patch) | |
tree | b53da1837d497a19713b5cfaefe19ad995f89318 /share | |
parent | e7b3ed755e186d2156e8c12a7155e635cab7f2d1 (diff) |
Don't force -undefined into linker flags
This is important if the user wants to use a different value than the
ones supported here. Also, change the default of
cpp.allowUnresolvedSymbols to undefined in accordance with the design
philosophy that 'undefined' typically results in no flags passed. This
will make no difference for user projects since the only platform
affected is Darwin and on that platform '-undefined error' is default.
Change-Id: I5557da37f4ed8c609e98a6f74ad4b553cae0b817
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 2 | ||||
-rw-r--r-- | share/qbs/modules/cpp/gcc.js | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index db7869d92..c681e8175 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -318,7 +318,7 @@ Module { description: "whether to require app-extension-safe APIs only" } - property bool allowUnresolvedSymbols: false + property bool allowUnresolvedSymbols property bool combineCSources: false property bool combineCxxSources: false diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js index 4a57e83cb..8214373ab 100644 --- a/share/qbs/modules/cpp/gcc.js +++ b/share/qbs/modules/cpp/gcc.js @@ -303,15 +303,11 @@ function linkerFlags(project, product, inputs, output, linkerPath) { args.push("--sysroot=" + sysroot); // do not escape, compiler-as-linker also needs it } - if (isDarwin) { - var unresolvedSymbolsAction; - unresolvedSymbolsAction = product.cpp.allowUnresolvedSymbols - ? "suppress" : "error"; - args = args.concat(escapeLinkerFlags(product, inputs, - ["-undefined", unresolvedSymbolsAction])); - } else if (product.cpp.allowUnresolvedSymbols) { - args = args.concat(escapeLinkerFlags(product, inputs, - ["--unresolved-symbols=ignore-all"])); + if (product.cpp.allowUnresolvedSymbols) { + args = args.concat(escapeLinkerFlags( + product, inputs, isDarwin + ? ["-undefined", "suppress"] + : ["--unresolved-symbols=ignore-all"])); } for (i in rpaths) { |