meson.build: Make sure only first clang search dir is grabbed

The regex only works when there is two search dirs.
This commit is contained in:
JJ Roberts-White 2021-10-14 21:13:43 +11:00
parent 6a2a573e13
commit 994b33c667

View file

@ -67,7 +67,7 @@ if not headers_only
elif c_compiler.get_id() == 'clang'
clangdir = run_command('/bin/sh', '-c',
' '.join(c_compiler.cmd_array())
+ ' -print-search-dirs | sed -ne "s/libraries: =\(.*\):.*/\\1/p"',
+ ' -print-search-dirs | sed -ne "s/libraries: =\([^:]*\).*/\\1/p"',
env: ['LANG=C'],
check: true).stdout().strip()