Skip to content

Commit 4d8de28

Browse files
committed
Fallback to clang in PATH with meson
Some distributions put clang into a different path than the llvm binary path. For example, this is the case on NixOS / nixpkgs, which failed to find clang with meson before this patch. Author: Wolfgang Walther Reviewed-by: Nazir Bilal Yavuz, Alvaro Herrera, Peter Eisentraut Reviewed-by: Tristan Partin Discussion: https://www.postgresql.org/message-id/[email protected] Backpatch: 16-, where meson support was added
1 parent a00fae9 commit 4d8de28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

meson.build

+4-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,10 @@ if add_languages('cpp', required: llvmopt, native: false)
799799
llvm_binpath = llvm.get_variable(configtool: 'bindir')
800800

801801
ccache = find_program('ccache', native: true, required: false)
802-
clang = find_program(llvm_binpath / 'clang', required: true)
802+
803+
# Some distros put LLVM and clang in different paths, so fallback to
804+
# find via PATH, too.
805+
clang = find_program(llvm_binpath / 'clang', 'clang', required: true)
803806
endif
804807
elif llvmopt.auto()
805808
message('llvm requires a C++ compiler')

0 commit comments

Comments
 (0)