Commit 5cf8981a authored by Kevin Funk's avatar Kevin Funk

Merge remote-tracking branch 'origin/5.3'

parents 03346522 b2936f50
......@@ -29,7 +29,7 @@ if [ -z "$KDEV_PG_QT_VERSION" ]; then
fi
KF5_VERSION=v5.51.0
KDE_PLASMA_VERSION=v5.13.4 # note: need libksysguard commit a0e69617442d720c76da5ebe3323e7a977929db4 (patch which makes plasma dep optional)
KDE_APPLICATION_VERSION=v18.12.0
KDE_APPLICATION_VERSION=v18.12.1
GRANTLEE_VERSION=v5.1.0
OKTETA_VERSION=v0.25.5
......@@ -271,8 +271,6 @@ cp $(ldconfig -p | grep libEGL.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/ # Othe
cp $(ldconfig -p | grep libxcb.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/
ldd usr/bin/kdevelop | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true
cp /usr/bin/cmake usr/bin/cmake
ldd usr/bin/cmake | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true
#ldd usr/lib64/kdevelop/*.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true
#ldd usr/lib64/plugins/imageformats/*.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true
......
......@@ -181,11 +181,10 @@ ClangSupport::ClangSupport(QObject* parent, const QVariantList& )
{
const auto builtinDir = ClangHelpers::clangBuiltinIncludePath();
const auto headerToCheck = QLatin1String("cpuid.h");
if (!QFile::exists(builtinDir + QLatin1Char('/') + headerToCheck)) {
setErrorDescription(i18n("The clang builtin include path \"%1\" is invalid (missing %2 header).\n"
if (!ClangHelpers::isValidClangBuiltingIncludePath(builtinDir)) {
setErrorDescription(i18n("The clang builtin include path \"%1\" is invalid (missing cpuid.h header).\n"
"Try setting the KDEV_CLANG_BUILTIN_DIR environment variable manually to fix this.\n"
"See also: https://bugs.kde.org/show_bug.cgi?id=393779", builtinDir, headerToCheck));
"See also: https://bugs.kde.org/show_bug.cgi?id=393779", builtinDir));
return;
}
}
......
......@@ -311,6 +311,7 @@ QStringList ClangHelpers::headerExtensions()
QStringLiteral("hxx"),
QStringLiteral("hpp"),
QStringLiteral("tlh"),
QStringLiteral("cuh"),
QStringLiteral("h++"),
};
return headerExtensions;
......@@ -325,6 +326,7 @@ QStringList ClangHelpers::sourceExtensions()
QStringLiteral("c++"),
QStringLiteral("cxx"),
QStringLiteral("C"),
QStringLiteral("cu"),
QStringLiteral("m"),
QStringLiteral("mm"),
QStringLiteral("M"),
......@@ -369,11 +371,18 @@ QString ClangHelpers::clangVersion()
return clangVersion;
}
bool ClangHelpers::isValidClangBuiltingIncludePath(const QString& path)
{
return QFile::exists(path + QLatin1String("/cpuid.h"));
}
QString ClangHelpers::clangBuiltinIncludePath()
{
// use a lambda to store the result in a static variable which can be
// returned without recomputing the string on subsequent calls.
static const auto dir = []() -> QString {
auto dir = QString::fromUtf8(qgetenv("KDEV_CLANG_BUILTIN_DIR"));
if (!dir.isEmpty()) {
if (!dir.isEmpty() && isValidClangBuiltingIncludePath(dir)) {
clangDebug() << "Using dir from $KDEV_CLANG_BUILTIN_DIR:" << dir;
return dir;
}
......@@ -382,8 +391,19 @@ QString ClangHelpers::clangBuiltinIncludePath()
// attempt to use the bundled copy on Windows
dir = QDir::cleanPath(QStringLiteral("%1/../lib/clang/%2/include")
.arg(QCoreApplication::applicationDirPath(), clangVersion()));
clangDebug() << "Trying" << dir;
if (QFileInfo(dir).isDir()) {
if (isValidClangBuiltingIncludePath(dir)) {
clangDebug() << "Using builtin dir:" << dir;
return dir;
}
#elif defined(Q_OS_UNIX)
// a clang version upgrade since we were last built can
// cause problems if the "clang/$fullversion/include" path component
// changed. Try to generate the correct builtin_dir for the current
// major.minor.patchlevel version: pop the last 2 components then
// chdir through with the updated version directory.
dir = QDir::cleanPath(QStringLiteral(KDEV_CLANG_BUILTIN_DIR "/../../%1/include").arg(clangVersion()));
if (isValidClangBuiltingIncludePath(dir)) {
clangDebug() << "Using builtin dir:" << dir;
return dir;
}
#endif
......
......@@ -104,11 +104,20 @@ KDEVCLANGPRIVATE_EXPORT QString clangVersion();
/**
* @return The path containing Clang built includes (e.g. stddef.h, stdarg.h, cpuid.h)
* The returned path is the env. var KDEV_CLANG_BUILTIN_DIR when set otherwise the path
* to the headers used when kdev-clang was built, possibly updated for upgrades to
* the library (e.g. 7.0.0 -> 7.0.1).
* Returns an empty string if none of the checked locations contain the file cpuid.h .
*
* Also see: https://clang.llvm.org/docs/FAQ.html
*/
KDEVCLANGPRIVATE_EXPORT QString clangBuiltinIncludePath();
/**
* @return True if the given @a path is a valid clang builtin directory.
*/
KDEVCLANGPRIVATE_EXPORT bool isValidClangBuiltingIncludePath(const QString& path);
}
#endif //CLANGHELPERS_H
......@@ -179,8 +179,10 @@ QStringList mimeTypesList()
static const QStringList mimeTypes = {
QStringLiteral("text/x-chdr"),
QStringLiteral("text/x-c++hdr"),
QStringLiteral("text/vnd.nvidia.cuda.chdr"),
QStringLiteral("text/x-csrc"),
QStringLiteral("text/x-c++src"),
QStringLiteral("text/vnd.nvidia.cuda.csrc"),
QStringLiteral("text/x-objcsrc")
};
return mimeTypes;
......
......@@ -104,8 +104,11 @@ QVector<QByteArray> argsForSession(const QString& path, ParseSessionData::Option
// TODO: No proper mime type detection possible yet
// cf. https://bugs.freedesktop.org/show_bug.cgi?id=23700
if (path.endsWith(QLatin1String(".cu"), Qt::CaseInsensitive)) {
return {QByteArrayLiteral("-xcuda")};
if (path.endsWith(QLatin1String(".cu"), Qt::CaseInsensitive) ||
path.endsWith(QLatin1String(".cuh"), Qt::CaseInsensitive)) {
auto result = parserSettings.toClangAPI();
result.append(QByteArrayLiteral("-xcuda"));
return result;
}
if (parserSettings.parserOptions.isEmpty()) {
......
......@@ -54,7 +54,20 @@
<comment xml:lang="tr">NVIDIA CUDA C kaynak kodu</comment>
<comment xml:lang="uk">початковий код C NVIDIA CUDA</comment>
<comment xml:lang="zh_CN">NVIDIA CUDA C 源代码</comment>
<sub-class-of type="text/x-csrc"/>
<sub-class-of type="text/x-c++src"/>
<glob pattern="*.cu"/>
</mime-type>
<mime-type type="text/vnd.nvidia.cuda.chdr">
<comment>NVIDIA CUDA C header</comment>
<comment xml:lang="ca">Capçalera en C per a CUDA de NVIDIA</comment>
<comment xml:lang="ca@valencia">Capçalera en C per a CUDA de NVIDIA</comment>
<comment xml:lang="es">Cabecera de NVIDIA CUDA C</comment>
<comment xml:lang="nl">NVIDIA CUDA C header</comment>
<comment xml:lang="pt">Ficheiro de inclusão em CUDA C da NVIDIA</comment>
<comment xml:lang="sv">NVIDIA CUDA C-deklarationsfil</comment>
<comment xml:lang="uk">файл заголовків C NVIDIA CUDA</comment>
<sub-class-of type="text/x-c++hdr"/>
<glob pattern="*.cuh"/>
</mime-type>
</mime-info>
......@@ -72,6 +72,7 @@
"text/x-c++src",
"text/x-opencl-src",
"text/vnd.nvidia.cuda.csrc",
"text/vnd.nvidia.cuda.chdr",
"text/x-objcsrc"
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment