# SOFTWARE.
project('dbus',
- 'c', 'cpp',
+ 'c',
version: '1.14.99',
meson_version: '>=0.56',
)
project_url = 'https://gitlab.freedesktop.org/dbus/dbus'
cc = meson.get_compiler('c')
-cpp = meson.get_compiler('cpp')
windows = import('windows')
pkgconfig = import('pkgconfig')
platform_windows = host_os.contains('windows')
+if platform_windows
+ # On Windows, we use C++ constructors to initialize global locks
+ using_cpp = true
+ add_languages('cpp', required: true)
+ cpp = meson.get_compiler('cpp')
+else
+ using_cpp = false
+endif
+
platform_cygwin = host_os.contains('cygwin')
# TODO: meson doesn't actually have WinCE support
endif
compile_args_c = cc.get_supported_arguments(compile_args)
-compile_args_cpp = cpp.get_supported_arguments(compile_args)
add_project_arguments(compile_args_c, language: 'c')
-add_project_arguments(compile_args_cpp, language: 'cpp')
+
+if using_cpp
+ compile_args_cpp = cpp.get_supported_arguments(compile_args)
+ add_project_arguments(compile_args_cpp, language: 'cpp')
+endif
if host_machine.endian() == 'big'
config.set('WORDS_BIGENDIAN', 1)
endif
compile_warnings_c = cc.get_supported_arguments(compile_warnings + compile_warnings_c)
-compile_warnings_cpp = cpp.get_supported_arguments(compile_warnings)
add_project_arguments(compile_warnings_c, language: 'c')
-add_project_arguments(compile_warnings_cpp, language: 'cpp')
link_args = cc.get_supported_link_arguments(link_args)
-add_project_link_arguments(link_args, language: ['c', 'cpp'])
+add_project_link_arguments(link_args, language: ['c'])
+
+if using_cpp
+ compile_warnings_cpp = cpp.get_supported_arguments(compile_warnings)
+ add_project_arguments(compile_warnings_cpp, language: 'cpp')
+ add_project_link_arguments(link_args, language: ['cpp'])
+endif
root_include = include_directories('.')
'source code location': meson.project_source_root(),
'compiler': cc.get_id(),
'cflags': compile_args_c + compile_warnings_c,
- 'cxxflags': compile_args_cpp + compile_warnings_cpp,
+}
+
+if using_cpp
+ summary_dict += {
+ 'cxxflags': compile_args_cpp + compile_warnings_cpp,
+ }
+endif
+
+summary_dict += {
'ldflags': (link_args.length() == 0) ? '[]' : link_args,
'64-bit int': arch_config.get('DBUS_INT64_TYPE'),
'32-bit int': arch_config.get('DBUS_INT32_TYPE'),