2014-01-06 18:19:44 +01:00
|
|
|
import qbs
|
|
|
|
|
import qbs.File
|
2015-06-01 18:51:55 +02:00
|
|
|
import QtcClangInstallation as Clang
|
2015-08-03 14:08:58 +02:00
|
|
|
import QtcFunctions
|
2014-06-27 15:48:00 +02:00
|
|
|
import QtcProcessOutputReader
|
2014-01-06 18:19:44 +01:00
|
|
|
|
|
|
|
|
QtcPlugin {
|
|
|
|
|
name: "ClangCodeModel"
|
|
|
|
|
|
|
|
|
|
Depends { name: "Qt"; submodules: ["concurrent", "widgets"] }
|
|
|
|
|
Depends { name: "Core" }
|
|
|
|
|
Depends { name: "CppTools" }
|
|
|
|
|
Depends { name: "ProjectExplorer" }
|
|
|
|
|
Depends { name: "TextEditor" }
|
|
|
|
|
Depends { name: "Utils" }
|
2015-06-16 11:56:00 +02:00
|
|
|
Depends { name: "ClangBackEndIpc" }
|
2015-05-08 15:48:17 +02:00
|
|
|
|
|
|
|
|
pluginTestDepends: [
|
|
|
|
|
"CppEditor",
|
|
|
|
|
"QmakeProjectManager",
|
|
|
|
|
]
|
2014-01-06 18:19:44 +01:00
|
|
|
|
|
|
|
|
property bool clangCompletion: true
|
|
|
|
|
property bool clangHighlighting: true
|
|
|
|
|
property bool clangIndexing: false
|
|
|
|
|
|
2015-08-03 14:08:58 +02:00
|
|
|
property string llvmConfig: Clang.llvmConfig(qbs, QtcFunctions, QtcProcessOutputReader)
|
2015-06-01 18:51:55 +02:00
|
|
|
property string llvmIncludeDir: Clang.includeDir(llvmConfig, QtcProcessOutputReader)
|
|
|
|
|
property string llvmLibDir: Clang.libDir(llvmConfig, QtcProcessOutputReader)
|
|
|
|
|
property string llvmLibs: Clang.libraries(qbs.targetOS)
|
|
|
|
|
property string llvmVersion: Clang.version(llvmConfig, QtcProcessOutputReader)
|
2014-01-06 18:19:44 +01:00
|
|
|
|
2015-09-04 10:21:41 +02:00
|
|
|
condition: llvmConfig && File.exists(llvmIncludeDir.concat("/clang-c/Index.h"))
|
2014-01-06 18:19:44 +01:00
|
|
|
|
2014-06-27 15:48:00 +02:00
|
|
|
cpp.includePaths: base.concat(llvmIncludeDir)
|
|
|
|
|
cpp.libraryPaths: base.concat(llvmLibDir)
|
2014-01-06 18:19:44 +01:00
|
|
|
cpp.rpaths: cpp.libraryPaths
|
2015-06-01 18:51:55 +02:00
|
|
|
cpp.dynamicLibraries: base.concat(llvmLibs)
|
2014-01-06 18:19:44 +01:00
|
|
|
|
2014-06-27 15:48:00 +02:00
|
|
|
cpp.defines: {
|
|
|
|
|
var defines = base;
|
|
|
|
|
defines.push('CLANG_VERSION="' + llvmVersion + '"');
|
|
|
|
|
defines.push('CLANG_RESOURCE_DIR="' + llvmLibDir + '/clang/' + llvmVersion + '/include"');
|
|
|
|
|
if (clangCompletion)
|
|
|
|
|
defines.push("CLANG_COMPLETION");
|
|
|
|
|
if (clangHighlighting)
|
|
|
|
|
defines.push("CLANG_HIGHLIGHTING");
|
|
|
|
|
if (clangIndexing)
|
|
|
|
|
defines.push("CLANG_INDEXING");
|
|
|
|
|
return defines;
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-06 18:19:44 +01:00
|
|
|
Group {
|
|
|
|
|
name: "Completion support"
|
|
|
|
|
condition: product.clangCompletion
|
|
|
|
|
files: [
|
2015-07-23 13:01:02 +02:00
|
|
|
"activationsequencecontextprocessor.cpp",
|
|
|
|
|
"activationsequencecontextprocessor.h",
|
2015-07-08 14:07:13 +02:00
|
|
|
"activationsequenceprocessor.cpp",
|
|
|
|
|
"activationsequenceprocessor.h",
|
2015-07-06 12:05:02 +02:00
|
|
|
"clangassistproposal.cpp",
|
|
|
|
|
"clangassistproposal.h",
|
|
|
|
|
"clangassistproposalitem.cpp",
|
|
|
|
|
"clangassistproposalitem.h",
|
|
|
|
|
"clangassistproposalmodel.cpp",
|
|
|
|
|
"clangassistproposalmodel.h",
|
|
|
|
|
"clangcompletionassistinterface.cpp",
|
|
|
|
|
"clangcompletionassistinterface.h",
|
|
|
|
|
"clangcompletionassistprocessor.cpp",
|
|
|
|
|
"clangcompletionassistprocessor.h",
|
|
|
|
|
"clangcompletionassistprovider.cpp",
|
|
|
|
|
"clangcompletionassistprovider.h",
|
|
|
|
|
"clangfunctionhintmodel.cpp",
|
|
|
|
|
"clangfunctionhintmodel.h",
|
2014-01-06 18:19:44 +01:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
name: "Highlighting support"
|
|
|
|
|
condition: product.clangHighlighting
|
|
|
|
|
files: [
|
|
|
|
|
"cppcreatemarkers.cpp",
|
|
|
|
|
"cppcreatemarkers.h",
|
2015-11-18 17:07:44 +01:00
|
|
|
"highlightingmarksreporter.cpp",
|
|
|
|
|
"highlightingmarksreporter.h",
|
2014-01-06 18:19:44 +01:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
name: "Indexing support"
|
|
|
|
|
condition: product.clangIndexing
|
|
|
|
|
files: [
|
|
|
|
|
"clangindexer.cpp",
|
|
|
|
|
"clangindexer.h",
|
|
|
|
|
"index.cpp",
|
|
|
|
|
"index.h",
|
|
|
|
|
"indexer.cpp",
|
|
|
|
|
"indexer.h",
|
|
|
|
|
// "dependencygraph.h",
|
|
|
|
|
// "dependencygraph.cpp"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
name: "Tests"
|
|
|
|
|
condition: project.testsEnabled
|
|
|
|
|
prefix: "test/"
|
|
|
|
|
files: [
|
2015-09-17 11:53:58 +02:00
|
|
|
"data/clangtestdata.qrc",
|
2015-05-08 15:48:17 +02:00
|
|
|
"clangcodecompletion_test.cpp",
|
|
|
|
|
"clangcodecompletion_test.h",
|
2014-01-06 18:19:44 +01:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Group {
|
|
|
|
|
name: "Test resources"
|
2015-09-17 11:53:58 +02:00
|
|
|
prefix: "test/data/"
|
2014-01-06 18:19:44 +01:00
|
|
|
fileTags: "none"
|
2015-09-17 11:53:58 +02:00
|
|
|
files: [ "*" ]
|
|
|
|
|
excludeFiles: "clangtestdata.qrc"
|
2014-01-06 18:19:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
files: [
|
|
|
|
|
"clang_global.h",
|
2015-05-08 15:48:17 +02:00
|
|
|
"clangcompletioncontextanalyzer.cpp",
|
|
|
|
|
"clangcompletioncontextanalyzer.h",
|
2014-08-19 15:59:29 +02:00
|
|
|
"clangeditordocumentparser.cpp",
|
|
|
|
|
"clangeditordocumentparser.h",
|
|
|
|
|
"clangeditordocumentprocessor.cpp",
|
|
|
|
|
"clangeditordocumentprocessor.h",
|
2015-09-04 12:15:17 +02:00
|
|
|
"clangdiagnosticfilter.cpp",
|
|
|
|
|
"clangdiagnosticfilter.h",
|
|
|
|
|
"clangdiagnosticmanager.cpp",
|
|
|
|
|
"clangdiagnosticmanager.h",
|
2015-08-24 18:26:09 +02:00
|
|
|
"clangfixitoperation.cpp",
|
|
|
|
|
"clangfixitoperation.h",
|
|
|
|
|
"clangfixitoperationsextractor.cpp",
|
|
|
|
|
"clangfixitoperationsextractor.h",
|
2014-01-06 18:19:44 +01:00
|
|
|
"clangmodelmanagersupport.cpp",
|
|
|
|
|
"clangmodelmanagersupport.h",
|
|
|
|
|
"clangcodemodelplugin.cpp",
|
|
|
|
|
"clangcodemodelplugin.h",
|
|
|
|
|
"clangprojectsettings.cpp",
|
|
|
|
|
"clangprojectsettings.h",
|
|
|
|
|
"clangprojectsettingspropertiespage.cpp",
|
|
|
|
|
"clangprojectsettingspropertiespage.h",
|
|
|
|
|
"clangprojectsettingspropertiespage.ui",
|
2015-11-24 11:17:18 +01:00
|
|
|
"clangsymbol.cpp",
|
|
|
|
|
"clangsymbol.h",
|
2015-08-31 16:28:26 +02:00
|
|
|
"clangtextmark.cpp",
|
|
|
|
|
"clangtextmark.h",
|
2014-01-06 18:19:44 +01:00
|
|
|
"clangutils.cpp",
|
|
|
|
|
"clangutils.h",
|
2015-06-16 11:56:00 +02:00
|
|
|
"clangbackendipcintegration.cpp",
|
|
|
|
|
"clangbackendipcintegration.h",
|
2015-05-08 15:48:17 +02:00
|
|
|
"completionchunkstotextconverter.cpp",
|
|
|
|
|
"completionchunkstotextconverter.h",
|
2014-01-06 18:19:44 +01:00
|
|
|
"constants.h",
|
|
|
|
|
"cxprettyprinter.cpp",
|
|
|
|
|
"cxprettyprinter.h",
|
|
|
|
|
"cxraii.h",
|
|
|
|
|
"diagnostic.cpp",
|
|
|
|
|
"diagnostic.h",
|
|
|
|
|
"fastindexer.cpp",
|
|
|
|
|
"fastindexer.h",
|
|
|
|
|
"pchinfo.cpp",
|
|
|
|
|
"pchinfo.h",
|
|
|
|
|
"pchmanager.cpp",
|
|
|
|
|
"pchmanager.h",
|
|
|
|
|
"semanticmarker.cpp",
|
|
|
|
|
"semanticmarker.h",
|
|
|
|
|
"sourcelocation.cpp",
|
|
|
|
|
"sourcelocation.h",
|
|
|
|
|
"sourcemarker.cpp",
|
|
|
|
|
"sourcemarker.h",
|
|
|
|
|
"unit.cpp",
|
|
|
|
|
"unit.h",
|
|
|
|
|
"unsavedfiledata.cpp",
|
|
|
|
|
"unsavedfiledata.h",
|
|
|
|
|
"utils.cpp",
|
|
|
|
|
"utils.h",
|
|
|
|
|
"utils_p.cpp",
|
|
|
|
|
"utils_p.h",
|
|
|
|
|
"raii/scopedclangoptions.cpp",
|
|
|
|
|
"raii/scopedclangoptions.h",
|
|
|
|
|
]
|
|
|
|
|
}
|