Fix meson build when clang headers don't exist.

This commit is contained in:
Stephen Houston 2017-10-10 10:05:06 -05:00
parent bf182698be
commit 3908d27b67
2 changed files with 4 additions and 1 deletions

View File

@ -40,6 +40,7 @@ else
endif
if get_option('libclang') == true and cc.has_header('clang-c/Index.h')
has_clang_header = true
clang = cc.find_library('clang', dirs : ['/usr/local/opt/llvm/lib'])
clang_include_dir_command = run_command(find_program('scripts/clang_include_dir.sh'))
@ -47,6 +48,8 @@ if get_option('libclang') == true and cc.has_header('clang-c/Index.h')
config_h.set_quoted('CLANG_INCLUDES', clang_include_dir)
config_h.set('HAVE_LIBCLANG', '1')
else
has_clang_header = false
endif
subdir('po')

View File

@ -28,7 +28,7 @@ endforeach
deps = [elm, edi_lib, intl]
incls = []
if get_option('libclang') == true
if get_option('libclang') == true and has_clang_header == true
deps += [clang]
clang_build_include_dir_command = run_command(find_program('../../scripts/clang_build_include_dir.sh'))