Revert "meson: remove exposure of lookup paths"

This reverts commit a7a6b9cb7f.

This brings back the option for settings the path, ubuntu decides to hide the headers in a none standard directory, so they need to be spectified.
This commit is contained in:
Marcel 2017-11-03 21:09:37 +00:00
parent 955213eb33
commit 2c062ef0bb
2 changed files with 15 additions and 9 deletions

View File

@ -40,20 +40,24 @@ else
config_h.set_quoted('BEAR_COMMAND', '')
endif
clang_header_dir = ''
clang_link_dir = ''
opt_clang_header_dir = get_option('libclang-headerdir')
opt_clang_link_dir = get_option('libclang-libdir')
if build_machine.system() == 'darwin'
clang_header_dir = '/usr/local/opt/llvm/include'
clang_link_dir = '/usr/local/opt/llvm/lib'
if opt_clang_header_dir == ''
opt_clang_header_dir = '/usr/local/opt/llvm/include'
endif
if opt_clang_link_dir == ''
opt_clang_link_dir = '/usr/local/opt/llvm/lib'
endif
endif
if get_option('libclang') == true
#check for the header
found = false
if clang_header_dir != ''
found = cc.has_header('clang-c/Index.h', args : '-I'+clang_header_dir)
if opt_clang_header_dir != ''
found = cc.has_header('clang-c/Index.h', args : '-I'+opt_clang_header_dir)
else
found = cc.has_header('clang-c/Index.h')
endif
@ -62,11 +66,11 @@ if get_option('libclang') == true
error('Clang header not found!')
endif
clang_inc = include_directories(clang_header_dir)
clang_inc = include_directories(opt_clang_header_dir)
#check for the library to link
if clang_link_dir != ''
clang = cc.find_library('clang', dirs : [clang_link_dir])
if opt_clang_link_dir != ''
clang = cc.find_library('clang', dirs : [opt_clang_link_dir])
else
clang = cc.find_library('clang')
endif

View File

@ -1,2 +1,4 @@
option('libclang', type : 'boolean', value : true, description : 'Weather to have libclang support')
option('bear', type : 'boolean', value : true, description : 'Weather to have bear support')
option('libclang-libdir', type : 'string', value : '', description : 'Specify a none default location for your clang installation')
option('libclang-headerdir', type : 'string', value : '', description : 'Specify a none default location for your clang installation')