meson: Rename cpp variable to cxx
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 9 Jan 2026 07:58:23 +0000 (08:58 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 9 Jan 2026 07:58:23 +0000 (08:58 +0100)
Since CPP is also used to mean C PreProcessor in our meson.build
files, it's confusing to use it to also mean C PlusPlus.  This uses
the non-ambiguous cxx wherever possible.

Author: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/flat/D98JHQF7H2A8.VSE3I4CJBTAB%40partin.io

meson.build
src/backend/meson.build

index 2064d1b0a8d653dd6f632d9d4d4ddc200b26dd02..2a195d56a4cc6f2ac48ac222dba3de747d465151 100644 (file)
@@ -843,7 +843,7 @@ if add_languages('cpp', required: llvmopt, native: false)
 
     cdata.set('USE_LLVM', 1)
 
-    cpp = meson.get_compiler('cpp')
+    cxx = meson.get_compiler('cpp')
 
     llvm_binpath = llvm.get_variable(configtool: 'bindir')
 
@@ -1917,10 +1917,10 @@ endforeach
 # We need to repeat the test for C++ because gcc and clang prefer different
 # format archetypes.
 if llvm.found()
-  attrib_error_args = cpp.get_supported_arguments('-Werror=format', '-Werror=ignored-attributes')
+  attrib_error_args = cxx.get_supported_arguments('-Werror=format', '-Werror=ignored-attributes')
   foreach a : printf_attributes
-    if cpp.compiles(testsrc.format(a),
-        args: attrib_error_args, name: 'cppformat ' + a)
+    if cxx.compiles(testsrc.format(a),
+        args: attrib_error_args, name: 'cxxformat ' + a)
       cdata.set('PG_CXX_PRINTF_ATTRIBUTE', a)
       break
     endif
@@ -2084,7 +2084,7 @@ common_functional_flags = [
 
 cflags += cc.get_supported_arguments(common_functional_flags)
 if llvm.found()
-  cxxflags += cpp.get_supported_arguments(common_functional_flags)
+  cxxflags += cxx.get_supported_arguments(common_functional_flags)
 endif
 
 vectorize_cflags = cc.get_supported_arguments(['-ftree-vectorize'])
@@ -2108,7 +2108,7 @@ common_warning_flags = [
 
 cflags_warn += cc.get_supported_arguments(common_warning_flags)
 if llvm.found()
-  cxxflags_warn += cpp.get_supported_arguments(common_warning_flags)
+  cxxflags_warn += cxx.get_supported_arguments(common_warning_flags)
 endif
 
 # A few places with imported code get a pass on -Wdeclaration-after-statement, remember
@@ -2161,7 +2161,7 @@ foreach w : negative_warning_flags
   if cc.has_argument('-W' + w)
     cflags_warn += '-Wno-' + w
   endif
-  if llvm.found() and cpp.has_argument('-W' + w)
+  if llvm.found() and cxx.has_argument('-W' + w)
     cxxflags_warn += '-Wno-' + w
   endif
 endforeach
@@ -2230,7 +2230,7 @@ endif
 
 cflags_builtin = cc.get_supported_arguments(common_builtin_flags)
 if llvm.found()
-  cxxflags_builtin = cpp.get_supported_arguments(common_builtin_flags)
+  cxxflags_builtin = cxx.get_supported_arguments(common_builtin_flags)
 endif
 
 
@@ -3953,7 +3953,7 @@ summary(
 if llvm.found()
   summary(
     {
-      'C++ compiler': '@0@ @1@'.format(cpp.get_id(), cpp.version()),
+      'C++ compiler': '@0@ @1@'.format(cxx.get_id(), cxx.version()),
     },
     section: 'Compiler',
   )
index de0a5fa1f7d1fbf312f19608b65e3f6796b57a4b..712a857cdb40d715c3d456044b62bbf0961642a5 100644 (file)
@@ -141,7 +141,7 @@ postgres = executable('postgres',
 backend_targets += postgres
 
 pg_mod_c_args = cflags_mod
-pg_mod_cpp_args = cxxflags_mod
+pg_mod_cxx_args = cxxflags_mod
 pg_mod_link_args = ldflags_sl + ldflags_mod
 pg_mod_link_depend = []
 
@@ -176,7 +176,7 @@ backend_mod_code = declare_dependency(
 # normal extension modules
 pg_mod_args = default_mod_args + {
   'dependencies': [backend_mod_code],
-  'cpp_args': pg_mod_cpp_args,
+  'cpp_args': pg_mod_cxx_args,
   'link_depends': pg_mod_link_depend,
 }