summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2024-07-27 10:53:11 +0000
committerHeikki Linnakangas2024-07-27 10:53:11 +0000
commit4d8de281b5834c8f5e0be6ae21e884e69dffd4ce (patch)
treec707e93b8618150af0030683d8d24c3ebeef3cb9
parenta00fae9d43e5adabc56e64a4df6d332062666501 (diff)
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/ca8f37e1-a2c3-40e2-91f6-59c3d3652ad4@technowledgy.de Backpatch: 16-, where meson support was added
-rw-r--r--meson.build5
1 files changed, 4 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 90e32397750..275c8698f11 100644
--- a/meson.build
+++ b/meson.build
@@ -799,7 +799,10 @@ if add_languages('cpp', required: llvmopt, native: false)
llvm_binpath = llvm.get_variable(configtool: 'bindir')
ccache = find_program('ccache', native: true, required: false)
- clang = find_program(llvm_binpath / 'clang', required: true)
+
+ # Some distros put LLVM and clang in different paths, so fallback to
+ # find via PATH, too.
+ clang = find_program(llvm_binpath / 'clang', 'clang', required: true)
endif
elif llvmopt.auto()
message('llvm requires a C++ compiler')