diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2013-06-18 09:22:13 -0400 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-06-24 14:13:26 +0200 |
commit | 6a80478c97a534c1a635d2f9488f45b0f85e1c68 (patch) | |
tree | c4530c1709417eae9500bdfa732104216f3a590c | |
parent | 954eba8ec6607e4b8e0afd46845842ae09a4093c (diff) |
Implement support for prefix headers (Xcode) / forced includes (MSVC).
Task-number: QBS-313
Change-Id: Idc66a671a9c634ef142887fb374d99da3ba96bb1
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | doc/qbs.qdoc | 9 | ||||
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 1 | ||||
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 6 | ||||
-rw-r--r-- | share/qbs/modules/cpp/msvc.js | 4 |
4 files changed, 20 insertions, 0 deletions
diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index 6d56a1bbf..ef3f5529a 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -1111,6 +1111,15 @@ List of static libraries to be linked. If the library is part of your project, consider using a Depends item instead. + \section2 prefixHeaders + + \table + \row \li \b{Type:} \li \c{pathList} + \row \li \b{Default:} \li \c{undefined} + \endtable + + List of files to automatically include at the beginning of each source file in the product. + \section2 precompiledHeader \table diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index c539c4cc6..56e46de69 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -9,6 +9,7 @@ Module { property string architecture: qbs.architecture property string optimization: qbs.optimization property bool debugInformation: qbs.debugInformation + property pathList prefixHeaders property path precompiledHeader property path precompiledHeaderDir: product.buildDirectory property stringList defines diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index 7f5d095b8..f30c66db0 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -268,6 +268,12 @@ CppModule { args.push('-fvisibility=default') } + var prefixHeaders = ModUtils.moduleProperty(product, "prefixHeaders"); + for (i in prefixHeaders) { + args.push('-include'); + args.push(prefixHeaders[i]); + } + args = args.concat(ModUtils.moduleProperties(input, 'platformCommonCompilerFlags')); for (i = 0, c = input.fileTags.length; i < c; ++i) { if (input.fileTags[i] === "cpp") { diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index 8d9f187b2..5da695dc1 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -59,6 +59,10 @@ function prepareCompiler(product, input, outputs, platformDefines, defines, incl args.push('/Fo' + FileInfo.toWindowsSeparators(objOutput.fileName)) args.push(FileInfo.toWindowsSeparators(input.fileName)) + var prefixHeaders = ModUtils.moduleProperty(product, "prefixHeaders"); + for (i in prefixHeaders) + args.push("/FI" + FileInfo.toWindowsSeparators(prefixHeaders[i])); + if (isCxx) { // precompiled header file var pch = ModUtils.moduleProperty(product, "precompiledHeader") |