aboutsummaryrefslogtreecommitdiffstats
path: root/test/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-05-27 18:43:30 -0400
committerDavid Robillard <d@drobilla.net>2021-05-27 19:16:02 -0400
commit9ecda141fe54d0e515a80c20cbe681982c5797e6 (patch)
tree5ea2d32b1908593d6b0c04cd1be043271ce4239d /test/meson.build
parent5e1ca2099a912d88c57320f61a6f316d2e7c67b7 (diff)
downloadpugl-9ecda141fe54d0e515a80c20cbe681982c5797e6.tar.gz
pugl-9ecda141fe54d0e515a80c20cbe681982c5797e6.tar.bz2
pugl-9ecda141fe54d0e515a80c20cbe681982c5797e6.zip
Add test for building the implementation as included C++
Diffstat (limited to 'test/meson.build')
-rw-r--r--test/meson.build41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/meson.build b/test/meson.build
index de4bd71..bd838f3 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -65,3 +65,44 @@ if vulkan_dep.found()
dependencies: [pugl_dep, vulkan_backend_dep]))
endforeach
endif
+
+unified_args = []
+unified_deps = [core_deps]
+if cairo_dep.found()
+ unified_args += ['-DWITH_CAIRO']
+ unified_deps += [cairo_dep]
+endif
+
+if opengl_dep.found()
+ unified_args += ['-DWITH_OPENGL']
+ unified_deps += [opengl_dep]
+endif
+
+if vulkan_dep.found()
+ unified_args += ['-DWITH_VULKAN']
+ unified_deps += [vulkan_deps]
+endif
+
+if host_machine.system() == 'darwin'
+ add_languages(['objcpp'])
+
+ objcpp = meson.get_compiler('objcpp')
+ unified_args += objcpp.get_supported_arguments(
+ c_warnings + cpp_warnings + objc_warnings)
+
+ executable('inline_objcpp', 'test_inline_objcpp.mm',
+ include_directories: include_directories(includes),
+ dependencies: unified_deps,
+ objcpp_args: unified_args)
+elif is_variable('cpp')
+ if cpp.get_id() == 'msvc'
+ unified_args += [
+ '/wd4464' # relative include path contains '..'
+ ]
+ endif
+
+ executable('inline_cpp', 'test_inline_cpp.cpp',
+ include_directories: include_directories(includes),
+ dependencies: unified_deps,
+ cpp_args: unified_args)
+endif