diff options
author | Marco Bubke <marco.bubke@theqtcompany.com> | 2015-06-01 18:51:55 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-06-03 14:22:09 +0000 |
commit | e2f8a9883b84db38bdcd2dfca27ebe2bc2934ecb (patch) | |
tree | 909c5d415465ecfc2e2bf9a13126a24c4e2fddfc /qbs | |
parent | 51fec1a3caa413b3d8901f45807d80a77554a017 (diff) |
Introduce codemodelbackend process and library
This is a partial result of wip/clang-oop. More will follow.
This allows us to invoke the completion out of the Qt Creator process
and thus safes us as against libclang crashes.
At this point only the completion use case is supported.
Some notes on the individual components:
src/libs/codemodelbackendipc
* library encapsulating the inter process communication handling
* used by the backend application and in a follow-up change by the
creator integration
src/libs/3rdparty/sqlite
* version 3.8.10.2
* dependency of codemodelbackendipc, will be used to storage indexing
data, among others
src/tools/codemodelbackend
* the backend application
tests/unit:
* unit tests
Change-Id: I91a48e27467581a22fb760a18d8eb926008fea60
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'qbs')
-rw-r--r-- | qbs/imports/QtcClangInstallation/functions.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/qbs/imports/QtcClangInstallation/functions.js b/qbs/imports/QtcClangInstallation/functions.js new file mode 100644 index 00000000000..682211a06f2 --- /dev/null +++ b/qbs/imports/QtcClangInstallation/functions.js @@ -0,0 +1,52 @@ +function llvmConfig(qbs) +{ + var llvmInstallDirFromEnv = qbs.getEnv("LLVM_INSTALL_DIR") + var llvmConfigVariants = [ + "llvm-config", "llvm-config-3.2", "llvm-config-3.3", "llvm-config-3.4", + "llvm-config-3.5", "llvm-config-3.6", "llvm-config-4.0", "llvm-config-4.1" + ]; + + // Prefer llvm-config* from LLVM_INSTALL_DIR + if (llvmInstallDirFromEnv) { + for (var i = 0; i < llvmConfigVariants.length; ++i) { + var variant = llvmInstallDirFromEnv + "/bin/" + llvmConfigVariants[i]; + if (File.exists(variant)) + return variant; + } + } + + // Find llvm-config* in PATH + var pathListString = qbs.getEnv("PATH"); + var separator = qbs.hostOS.contains("windows") ? ";" : ":"; + var pathList = pathListString.split(separator); + for (var i = 0; i < llvmConfigVariants.length; ++i) { + for (var j = 0; j < pathList.length; ++j) { + var variant = pathList[j] + "/" + llvmConfigVariants[i]; + if (File.exists(variant)) + return variant; + } + } + + return undefined; +} + +function includeDir(llvmConfig, processOutputReader) +{ + return processOutputReader.readOutput(llvmConfig, ["--includedir"]) +} + +function libDir(llvmConfig, processOutputReader) +{ + return processOutputReader.readOutput(llvmConfig, ["--libdir"]) +} + +function version(llvmConfig, processOutputReader) +{ + return processOutputReader.readOutput(llvmConfig, ["--version"]) + .replace(/(\d+\.\d+\.\d+).*/, "$1") +} + +function libraries(targetOS) +{ + return ["clang"] + (targetOS.contains("windows") ? ["advapi32", "shell32"] : []) +} |