From 6078ec2961f6099d05995b22d3397572834b3465 Mon Sep 17 00:00:00 2001 From: Zhao Junwang Date: Fri, 22 Dec 2023 17:16:04 +0800 Subject: [PATCH] PGXS determine C++ compiler for Makefile.global Signed-off-by: Zhao Junwang --- meson_options.txt | 3 +++ src/makefiles/meson.build | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index be1b327f54..02c0e48a46 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -112,6 +112,9 @@ option('libxslt', type: 'feature', value: 'auto', option('llvm', type: 'feature', value: 'disabled', description: 'LLVM support') +option('pgxscpp', type: 'feature', value: 'disabled', + description: 'PGXS determine C++ compiler for Makefile.global') + option('lz4', type: 'feature', value: 'auto', description: 'LZ4 support') diff --git a/src/makefiles/meson.build b/src/makefiles/meson.build index be946f7b38..979a0dd8c4 100644 --- a/src/makefiles/meson.build +++ b/src/makefiles/meson.build @@ -127,9 +127,19 @@ if llvm.found() else pgxs_kv += { 'CLANG': '', - 'CXX': '', 'LLVM_BINPATH': '', } + pgxscppopt = get_option('pgxscpp') + if add_languages('cpp', required: pgxscppopt, native: false) + cpp = meson.get_compiler('cpp') + pgxs_kv += { + 'CXX': ' '.join(cpp.cmd_array()), + } + else + pgxs_kv += { + 'CXX': '', + } + endif endif pgxs_bins = { -- 2.41.0