Commit 6da2caac authored by Bernd Buschinski's avatar Bernd Buschinski

Fix discovery of clang builtin directory with clang svn versions

Summary:
The CLANG_VERSION for svn clang versions have a svn suffix "8.0.0svn" and all the libraries have a svn suffix.
But not the in builtin include dir. It still points to
"/usr/lib/clang/8.0.0/include/cpuid.h"
without the suffix.

Extend the PATH_SUFFIXES to also looks a version without svn suffix.

BUG: 399439

Test Plan:
- install clang-svn
- execute cmake .. (for kdevelop)
-> it will fail

Reviewers: #kdevelop, kfunk

Reviewed By: #kdevelop, kfunk

Subscribers: kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D15998
parent 2e396b67
......@@ -93,6 +93,9 @@ if(CLANG_FOUND)
set(CLANG_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
set(CLANG_VERSION ${LLVM_VERSION})
# svn version of clang has a svn suffix "8.0.0svn" but installs the header in "8.0.0", without the suffix
string(REPLACE "svn" "" CLANG_VERSION_CLEAN "${CLANG_VERSION}")
find_path(CLANG_BUILTIN_DIR
# cpuid.h because it is defined in ClangSupport constructor as valid clang builtin dir indicator
NAMES "cpuid.h"
......@@ -100,6 +103,8 @@ if(CLANG_FOUND)
"${CLANG_INCLUDE_DIRS}"
PATH_SUFFIXES "clang/${CLANG_VERSION}/include"
"../../../clang/${CLANG_VERSION}/include"
"clang/${CLANG_VERSION_CLEAN}/include"
"../../../clang/${CLANG_VERSION_CLEAN}/include"
NO_DEFAULT_PATH
)
......
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