summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-11-01 22:03:11 +0100
committerLuboš Luňák <l.lunak@collabora.com>2019-11-04 10:30:02 +0100
commit65aeaac24dcad9bfbe7fecf54eab84c57a39857c (patch)
tree322939b8e99f73e47f46bd39f3e4d8a490eefb97 /configure.ac
parentdaa344f3e9683c16479ef5081fb03325af103c07 (diff)
find Clang headers also if it's Clang built from source
Change-Id: I2253bdce982028277b30d7bf911201675be45ca4 Reviewed-on: https://gerrit.libreoffice.org/81919 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 464129d6cc95..1711ea8a3623 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7028,6 +7028,17 @@ if test "$COM_IS_CLANG" = "TRUE"; then
if test -z "$CLANGLIBDIR"; then
CLANGLIBDIR=$($LLVM_CONFIG --libdir)
fi
+ # Try if clang is built from source (in which case its includes are not together with llvm includes).
+ # src-root is [llvm-toplevel-src-dir]/llvm, clang is [llvm-toplevel-src-dir]/clang
+ clangsrcdir=$(dirname $($LLVM_CONFIG --src-root))
+ if test -n "$clangsrcdir" -a -d "$clangsrcdir" -a -d "$clangsrcdir/clang/include"; then
+ COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangsrcdir/clang/include"
+ fi
+ # obj-root is [llvm-toplevel-obj-dir]/, clang is [llvm-toplevel-obj-dir]/tools/clang
+ clangobjdir=$($LLVM_CONFIG --obj-root)
+ if test -n "$clangobjdir" -a -d "$clangobjdir" -a -d "$clangobjdir/tools/clang/include"; then
+ COMPILER_PLUGINS_CXXFLAGS="$COMPILER_PLUGINS_CXXFLAGS -I$clangobjdir/tools/clang/include"
+ fi
fi
AC_MSG_NOTICE([compiler plugins compile flags: $COMPILER_PLUGINS_CXXFLAGS])
AC_LANG_PUSH([C++])