diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2021-09-27 17:19:30 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2021-09-28 10:44:44 +0000 |
commit | f25acf18be2cd917f71cad41123fafd42bbc8374 (patch) | |
tree | c0f7ec4491c0acc611b9b88bf9814f45452ec9f2 /share/qbs/modules/cpp/GenericGCC.qbs | |
parent | cd4f5c72820ebaa5b91a4cdd3cfe44173a018947 (diff) |
Unify generation of precompiled headers
This patch unifies the functions to generate the output file tags, and the
output artifacts for the precompiled headers.
Change-Id: I84be3f56037220ae5ade6e3d1d1a4e7d0a46847f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/cpp/GenericGCC.qbs')
-rw-r--r-- | share/qbs/modules/cpp/GenericGCC.qbs | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs index ac30708d4..47ab88a28 100644 --- a/share/qbs/modules/cpp/GenericGCC.qbs +++ b/share/qbs/modules/cpp/GenericGCC.qbs @@ -38,6 +38,7 @@ import qbs.TextFile import qbs.Utilities import qbs.UnixUtils import qbs.WindowsUtils +import 'cpp.js' as Cpp import 'gcc.js' as Gcc CppModule { @@ -119,6 +120,8 @@ CppModule { staticLibraryPrefix: "lib" staticLibrarySuffix: ".a" + precompiledHeaderSuffix: ".gch" + property bool compilerHasTargetOption: qbs.toolchain.contains("clang") && Utilities.versionCompare(compilerVersion, "3.1") >= 0 property bool assemblerHasTargetOption: qbs.toolchain.contains("xcode") @@ -656,10 +659,8 @@ CppModule { condition: useCPrecompiledHeader inputs: ["c_pch_src"] auxiliaryInputs: ["hpp"] - Artifact { - filePath: product.name + "_c.gch" - fileTags: ["c_pch"] - } + outputFileTags: Cpp.precompiledHeaderOutputTags("c", false) + outputArtifacts: Cpp.precompiledHeaderOutputArtifacts(input, product, "c", false) prepare: { return Gcc.prepareCompiler.apply(Gcc, arguments); } @@ -669,10 +670,8 @@ CppModule { condition: useCxxPrecompiledHeader inputs: ["cpp_pch_src"] auxiliaryInputs: ["hpp"] - Artifact { - filePath: product.name + "_cpp.gch" - fileTags: ["cpp_pch"] - } + outputFileTags: Cpp.precompiledHeaderOutputTags("cpp", false) + outputArtifacts: Cpp.precompiledHeaderOutputArtifacts(input, product, "cpp", false) prepare: { return Gcc.prepareCompiler.apply(Gcc, arguments); } @@ -682,10 +681,8 @@ CppModule { condition: useObjcPrecompiledHeader inputs: ["objc_pch_src"] auxiliaryInputs: ["hpp"] - Artifact { - filePath: product.name + "_objc.gch" - fileTags: ["objc_pch"] - } + outputFileTags: Cpp.precompiledHeaderOutputTags("objc", false) + outputArtifacts: Cpp.precompiledHeaderOutputArtifacts(input, product, "objc", false) prepare: { return Gcc.prepareCompiler.apply(Gcc, arguments); } @@ -695,10 +692,8 @@ CppModule { condition: useObjcxxPrecompiledHeader inputs: ["objcpp_pch_src"] auxiliaryInputs: ["hpp"] - Artifact { - filePath: product.name + "_objcpp.gch" - fileTags: ["objcpp_pch"] - } + outputFileTags: Cpp.precompiledHeaderOutputTags("objcpp", false) + outputArtifacts: Cpp.precompiledHeaderOutputArtifacts(input, product, "objcpp", false) prepare: { return Gcc.prepareCompiler.apply(Gcc, arguments); } |