Fix clang lookup dirs on osx

This commit is contained in:
Andy Williams 2017-10-04 23:52:29 +01:00
parent 2e69a791b7
commit dda9a59fc4
3 changed files with 10 additions and 2 deletions

View File

@ -38,7 +38,7 @@ else
endif endif
if get_option('libclang') == true if get_option('libclang') == true
clang = cc.find_library('clang', dirs : ['/Library/Developer/CommandLineTools/usr/lib/']) clang = cc.find_library('clang', dirs : ['/usr/local/opt/llvm/lib'])
clang_include_dir_command = run_command(find_program('scripts/clang_include_dir.sh')) clang_include_dir_command = run_command(find_program('scripts/clang_include_dir.sh'))
clang_include_dir = clang_include_dir_command.stdout().strip() clang_include_dir = clang_include_dir_command.stdout().strip()

View File

@ -1,3 +1,8 @@
#!/bin/sh #!/bin/sh
clang -E - -v < /dev/null 2>&1 | grep "^ /" | grep clang BINDIR=
if [[ -d /usr/local/opt/llvm ]]; then
BINDIR="/usr/local/opt/llvm/bin/"
fi
${BINDIR}clang -E - -v < /dev/null 2>&1 | grep "^ /" | grep clang

View File

@ -26,13 +26,16 @@ foreach package : packages
endforeach endforeach
deps = [elm, edi_lib] deps = [elm, edi_lib]
libs = []
if get_option('libclang') == true if get_option('libclang') == true
deps += [clang] deps += [clang]
libs += include_directories('/usr/local/opt/llvm/include')
endif endif
executable('edi', src, executable('edi', src,
dependencies : deps, dependencies : deps,
include_directories : libs,
install : true install : true
) )