GNOME Bugzilla – Bug 782296
Update the list of llvm-config names to include svn trunk on Debian
Last modified: 2017-05-08 22:16:02 UTC
I found commit 0ca0a3e moved llvm 4.0 to the top. This is correct because it became a stable release, but it didn't keep the svn trunk version on Debian (llvm-config-5.0) in the list. FreeBSD uses the name 'llvm-config-devel', so we don't have to add llvm-config50 unless it becomes a stable release.
Created attachment 351297 [details] [review] build: allow building with llvm svn trunk on Debian
Don't forget the meson.build file too.
Created attachment 351308 [details] [review] build: move llvm-config to the top If llvm-config exists, it should be the default LLVM version on the system and we should use it by default. This change also syncs the list with meson.
Created attachment 351309 [details] [review] build: allow building with llvm 4.0 and svn trunk
Created attachment 351310 [details] [review] meson-build: fix the libclang check Use args argument in cc.has_header because it doesn't support prefix. Add dirs argument to cc.find_library because we have to add extra search paths to find libclang on systems not installing it in the default search path. Replace 'llvm-config --ldflags' with 'llvm-config --libdir' because cc.find_library uses dirs argument instead of args. Remove link_args from clang_dep because using cc.find_library makes meson use the full path to the library. -L flags are not needed here.
The last patch is build-tested by manually modifying the generated build.ninja file because meson incorrectly reorders my LDFLAGS (https://github.com/mesonbuild/meson/issues/1718).
Also for what its worth next Meson release will handle llvm itself: https://github.com/mesonbuild/meson/commit/4bee51655bea9c8bebd3c55414d7daf13591fb59
We should simplify to use meson's new LLVMDependency once that is read. But LGTM for now. Attachment 351308 [details] pushed as 891a575 - build: move llvm-config to the top Attachment 351309 [details] pushed as 903498b - build: allow building with llvm 4.0 and svn trunk Attachment 351310 [details] pushed as 4319ce5 - meson-build: fix the libclang check