Skip to content

Commit 7fc064d

Browse files
committed
meson: Tie adding C++ support to the llvm Meson option
In the event the llvm option is defined to be 'auto', it is possible that the host machine might not have a C++ compiler. If that is the case, then we shouldn't continue reaching for the llvm dependency. To make it easier to understand the case where LLVM support is disabled due to lacking a C++ compiler, add a message noting that fact. Author: Tristan Partin <tristan@neon.tech> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CSPIJVUDZFKX.3KHMOAVGF94RV@c3po Backpatch: 16-, where meson support was added
1 parent 5a7280d commit 7fc064d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ endif
742742
###############################################################
743743

744744
llvmopt = get_option('llvm')
745-
if not llvmopt.disabled()
746-
add_languages('cpp', required: true, native: false)
745+
llvm = not_found_dep
746+
if add_languages('cpp', required: llvmopt, native: false)
747747
llvm = dependency('llvm', version: '>=3.9', method: 'config-tool', required: llvmopt)
748748

749749
if llvm.found()
@@ -757,8 +757,8 @@ if not llvmopt.disabled()
757757
ccache = find_program('ccache', native: true, required: false)
758758
clang = find_program(llvm_binpath / 'clang', required: true)
759759
endif
760-
else
761-
llvm = not_found_dep
760+
elif llvmopt.auto()
761+
message('llvm requires a C++ compiler')
762762
endif
763763

764764

0 commit comments

Comments
 (0)