forked from qt-creator/qt-creator
qbs build: Use precompiled headers.
It was an oversight that we haven't done this before. Change-Id: Ic338503f6c1ca5e6c52c9af3bdbdb92b7776cac1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -5,6 +5,7 @@ QtcProduct {
|
|||||||
type: ["dynamiclibrary", "dynamiclibrary_symlink", "qtc.dev-module"]
|
type: ["dynamiclibrary", "dynamiclibrary_symlink", "qtc.dev-module"]
|
||||||
installDir: qtc.ide_library_path
|
installDir: qtc.ide_library_path
|
||||||
installTags: ["dynamiclibrary", "dynamiclibrary_symlink"]
|
installTags: ["dynamiclibrary", "dynamiclibrary_symlink"]
|
||||||
|
useNonGuiPchFile: true
|
||||||
Depends {
|
Depends {
|
||||||
condition: qtc.testsEnabled
|
condition: qtc.testsEnabled
|
||||||
name: "Qt.test"
|
name: "Qt.test"
|
||||||
|
@@ -6,6 +6,7 @@ QtcProduct {
|
|||||||
type: ["dynamiclibrary", "pluginSpec", "qtc.dev-module"]
|
type: ["dynamiclibrary", "pluginSpec", "qtc.dev-module"]
|
||||||
installDir: qtc.ide_plugin_path
|
installDir: qtc.ide_plugin_path
|
||||||
installTags: ["dynamiclibrary"]
|
installTags: ["dynamiclibrary"]
|
||||||
|
useGuiPchFile: true
|
||||||
|
|
||||||
property var pluginJsonReplacements
|
property var pluginJsonReplacements
|
||||||
property var pluginRecommends: []
|
property var pluginRecommends: []
|
||||||
|
@@ -9,6 +9,11 @@ Product {
|
|||||||
property string installDir
|
property string installDir
|
||||||
property stringList installTags: type
|
property stringList installTags: type
|
||||||
property string fileName: FileInfo.fileName(sourceDirectory) + ".qbs"
|
property string fileName: FileInfo.fileName(sourceDirectory) + ".qbs"
|
||||||
|
property bool useNonGuiPchFile: false
|
||||||
|
property bool useGuiPchFile: false
|
||||||
|
property string pathToSharedSources: FileInfo.joinPaths(path,
|
||||||
|
FileInfo.relativePath(FileInfo.joinPaths('/', qtc.ide_qbs_imports_path),
|
||||||
|
FileInfo.joinPaths('/', qtc.ide_shared_sources_path)))
|
||||||
|
|
||||||
Depends { name: "cpp" }
|
Depends { name: "cpp" }
|
||||||
Depends { name: "qtc" }
|
Depends { name: "qtc" }
|
||||||
@@ -24,6 +29,7 @@ Product {
|
|||||||
}
|
}
|
||||||
cpp.minimumOsxVersion: "10.7"
|
cpp.minimumOsxVersion: "10.7"
|
||||||
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
|
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
|
||||||
|
cpp.useCxxPrecompiledHeader: useNonGuiPchFile || useGuiPchFile
|
||||||
cpp.visibility: "minimal"
|
cpp.visibility: "minimal"
|
||||||
|
|
||||||
Depends { name: "Qt.core" }
|
Depends { name: "Qt.core" }
|
||||||
@@ -39,4 +45,20 @@ Product {
|
|||||||
qbs.install: true
|
qbs.install: true
|
||||||
qbs.installDir: qtc.ide_qbs_modules_path + '/' + product.name
|
qbs.installDir: qtc.ide_qbs_modules_path + '/' + product.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Group {
|
||||||
|
name: "standard pch file (non-gui)"
|
||||||
|
condition: useNonGuiPchFile
|
||||||
|
prefix: pathToSharedSources + '/'
|
||||||
|
files: ["qtcreator_pch.h"]
|
||||||
|
fileTags: ["cpp_pch_src"]
|
||||||
|
}
|
||||||
|
|
||||||
|
Group {
|
||||||
|
name: "standard pch file (gui)"
|
||||||
|
condition: useGuiPchFile
|
||||||
|
prefix: pathToSharedSources + '/'
|
||||||
|
files: ["qtcreator_gui_pch.h"]
|
||||||
|
fileTags: ["cpp_pch_src"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ QtcProduct {
|
|||||||
type: ["application"]
|
type: ["application"]
|
||||||
consoleApplication: true
|
consoleApplication: true
|
||||||
installDir: qtc.ide_libexec_path
|
installDir: qtc.ide_libexec_path
|
||||||
|
useNonGuiPchFile: true
|
||||||
|
|
||||||
cpp.rpaths: {
|
cpp.rpaths: {
|
||||||
var relativePathToLibs = FileInfo.relativePath('/' + qtc.ide_libexec_path,
|
var relativePathToLibs = FileInfo.relativePath('/' + qtc.ide_libexec_path,
|
||||||
|
0
qbs/imports/src
Normal file
0
qbs/imports/src
Normal file
@@ -51,6 +51,7 @@ Module {
|
|||||||
property string ide_qbs_resources_path: "qbs-resources"
|
property string ide_qbs_resources_path: "qbs-resources"
|
||||||
property string ide_qbs_modules_path: ide_qbs_resources_path + "/modules"
|
property string ide_qbs_modules_path: ide_qbs_resources_path + "/modules"
|
||||||
property string ide_qbs_imports_path: ide_qbs_resources_path + "/imports"
|
property string ide_qbs_imports_path: ide_qbs_resources_path + "/imports"
|
||||||
|
property string ide_shared_sources_path: "src/shared"
|
||||||
|
|
||||||
property bool make_dev_package: false
|
property bool make_dev_package: false
|
||||||
|
|
||||||
|
16
src/shared/pch_files.qbs
Normal file
16
src/shared/pch_files.qbs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import qbs
|
||||||
|
import qbs.FileInfo
|
||||||
|
|
||||||
|
Product {
|
||||||
|
name: "precompiled headers"
|
||||||
|
condition: qtc.make_dev_package
|
||||||
|
Depends { name: "qtc" }
|
||||||
|
Group {
|
||||||
|
files: [
|
||||||
|
"qtcreator_pch.h",
|
||||||
|
"qtcreator_gui_pch.h",
|
||||||
|
]
|
||||||
|
qbs.install: true
|
||||||
|
qbs.installDir: qtc.ide_shared_sources_path
|
||||||
|
}
|
||||||
|
}
|
@@ -13,6 +13,7 @@ Project {
|
|||||||
"tools/tools.qbs",
|
"tools/tools.qbs",
|
||||||
project.sharedSourcesDir + "/json",
|
project.sharedSourcesDir + "/json",
|
||||||
project.sharedSourcesDir + "/proparser",
|
project.sharedSourcesDir + "/proparser",
|
||||||
|
project.sharedSourcesDir + "/pch_files.qbs",
|
||||||
]
|
]
|
||||||
|
|
||||||
property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs")
|
property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs")
|
||||||
|
Reference in New Issue
Block a user