diff options
-rw-r--r-- | bindings/cpp/meson.build | 15 | ||||
-rw-r--r-- | doc/_static/meson.build | 6 | ||||
-rw-r--r-- | doc/c/api/meson.build | 3 | ||||
-rw-r--r-- | doc/c/meson.build | 22 | ||||
-rw-r--r-- | doc/c/xml/meson.build | 18 | ||||
-rw-r--r-- | doc/cpp/api/meson.build | 3 | ||||
-rw-r--r-- | doc/cpp/meson.build | 22 | ||||
-rw-r--r-- | doc/cpp/xml/meson.build | 11 | ||||
-rw-r--r-- | examples/meson.build | 50 | ||||
-rw-r--r-- | examples/pugl_cairo_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_clipboard_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_cpp_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_cursor_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_embed_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_shader_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_vulkan_cpp_demo.app/meson.build | 24 | ||||
-rw-r--r-- | examples/pugl_vulkan_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/pugl_window_demo.app/MacOS/meson.build | 5 | ||||
-rw-r--r-- | examples/shaders/meson.build | 60 | ||||
-rw-r--r-- | meson.build | 208 | ||||
-rw-r--r-- | test/meson.build | 92 |
22 files changed, 349 insertions, 230 deletions
diff --git a/bindings/cpp/meson.build b/bindings/cpp/meson.build index 5dd30da..313f1df 100644 --- a/bindings/cpp/meson.build +++ b/bindings/cpp/meson.build @@ -4,12 +4,15 @@ subdir('include') puglpp_dep = declare_dependency( + dependencies: core_deps + [pugl_dep], include_directories: include_directories('include'), link_with: libpugl, - dependencies: core_deps + [pugl_dep]) +) -pkg.generate(name: 'Pugl++', - filebase: 'puglpp-@0@'.format(major_version), - subdirs: ['puglpp-@0@'.format(major_version)], - version: meson.project_version(), - description: 'Pugl GUI library C++ bindings') +pkg.generate( + description: 'Pugl GUI library C++ bindings', + filebase: 'puglpp-@0@'.format(major_version), + name: 'Pugl++', + subdirs: ['puglpp-@0@'.format(major_version)], + version: meson.project_version(), +) diff --git a/doc/_static/meson.build b/doc/_static/meson.build index d3296c6..ffaefcd 100644 --- a/doc/_static/meson.build +++ b/doc/_static/meson.build @@ -1,5 +1,9 @@ # Copyright 2021 David Robillard <d@drobilla.net> # SPDX-License-Identifier: CC0-1.0 OR ISC -configure_file(copy: true, input: '../../resources/pugl.svg', output: 'pugl.svg') +configure_file( + copy: true, + input: '../../resources/pugl.svg', + output: 'pugl.svg', +) diff --git a/doc/c/api/meson.build b/doc/c/api/meson.build index 001d908..7f5d26d 100644 --- a/doc/c/api/meson.build +++ b/doc/c/api/meson.build @@ -5,4 +5,5 @@ c_pugl_rst = custom_target( 'C API ReST Documentation', command: [dox_to_sphinx, '-f', '@INPUT0@', 'doc/c/api'], input: [c_index_xml] + c_rst_files, - output: 'pugl.rst') + output: 'pugl.rst', +) diff --git a/doc/c/meson.build b/doc/c/meson.build index 7954776..969727a 100644 --- a/doc/c/meson.build +++ b/doc/c/meson.build @@ -4,9 +4,11 @@ config = configuration_data() config.set('PUGL_VERSION', meson.project_version()) -conf_py = configure_file(configuration: config, - input: '../conf.py.in', - output: 'conf.py') +conf_py = configure_file( + configuration: config, + input: '../conf.py.in', + output: 'conf.py', +) configure_file(copy: true, input: '../deployment.rst', output: 'deployment.rst') configure_file(copy: true, input: '../summary.rst', output: 'summary.rst') @@ -31,20 +33,22 @@ subdir('api') docs = custom_target( 'singlehtml', + build_by_default: true, command: [sphinx_build, '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@', '-E', '-q', '-t', 'singlehtml'], input: [c_rst_files, c_pugl_rst, c_index_xml], - output: 'singlehtml', - build_by_default: true, install: true, - install_dir: docdir / 'pugl-0') + install_dir: docdir / 'pugl-0', + output: 'singlehtml', +) docs = custom_target( 'html', + build_by_default: true, command: [sphinx_build, '-M', 'html', '@OUTDIR@', '@OUTDIR@', '-E', '-q', '-t', 'html'], input: [c_rst_files, c_pugl_rst, c_index_xml], - output: 'html', - build_by_default: true, install: true, - install_dir: docdir / 'pugl-0') + install_dir: docdir / 'pugl-0', + output: 'html', +) diff --git a/doc/c/xml/meson.build b/doc/c/xml/meson.build index 7dfadbb..e1b715e 100644 --- a/doc/c/xml/meson.build +++ b/doc/c/xml/meson.build @@ -10,11 +10,15 @@ config = configuration_data() config.set('PUGL_SRCDIR', pugl_src_root) config.set('DOX_OUTPUT', meson.current_build_dir() / '..') -c_doxyfile = configure_file(configuration: config, - input: '../Doxyfile.in', - output: 'Doxyfile') +c_doxyfile = configure_file( + configuration: config, + input: '../Doxyfile.in', + output: 'Doxyfile', +) -c_index_xml = custom_target('c-index.xml', - command: [doxygen, '@INPUT0@'], - input: [c_doxyfile] + c_header_files, - output: 'index.xml') +c_index_xml = custom_target( + 'c-index.xml', + command: [doxygen, '@INPUT0@'], + input: [c_doxyfile] + c_header_files, + output: 'index.xml', +) diff --git a/doc/cpp/api/meson.build b/doc/cpp/api/meson.build index 9c81f6f..9ccdd0b 100644 --- a/doc/cpp/api/meson.build +++ b/doc/cpp/api/meson.build @@ -5,4 +5,5 @@ cpp_pugl_rst = custom_target( 'C++ API ReST Documentation', command: [dox_to_sphinx, '-l', 'cpp', '-f', '@INPUT@', '@OUTDIR@'], input: cpp_index_xml, - output: 'pugl.rst') + output: 'pugl.rst', +) diff --git a/doc/cpp/meson.build b/doc/cpp/meson.build index 559362d..bc7af98 100644 --- a/doc/cpp/meson.build +++ b/doc/cpp/meson.build @@ -4,9 +4,11 @@ config = configuration_data() config.set('PUGL_VERSION', meson.project_version()) -conf_py = configure_file(configuration: config, - input: '../conf.py.in', - output: 'conf.py') +conf_py = configure_file( + configuration: config, + input: '../conf.py.in', + output: 'conf.py', +) configure_file(copy: true, input: '../deployment.rst', output: 'deployment.rst') configure_file(copy: true, input: '../summary.rst', output: 'summary.rst') @@ -29,20 +31,22 @@ subdir('api') docs = custom_target( 'singlehtml', + build_by_default: true, command: [sphinx_build, '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@', '-E', '-q', '-t', 'singlehtml'], input: [cpp_rst_files, cpp_pugl_rst, cpp_index_xml], - output: 'singlehtml', - build_by_default: true, install: true, - install_dir: docdir / 'puglpp-0') + install_dir: docdir / 'puglpp-0', + output: 'singlehtml', +) docs = custom_target( 'html', command: [sphinx_build, '-M', 'html', '@OUTDIR@', '@OUTDIR@', '-E', '-q', '-t', 'html'], - input: [cpp_rst_files, cpp_pugl_rst, cpp_index_xml], - output: 'html', build_by_default: true, + input: [cpp_rst_files, cpp_pugl_rst, cpp_index_xml], install: true, - install_dir: docdir / 'puglpp-0') + install_dir: docdir / 'puglpp-0', + output: 'html', +) diff --git a/doc/cpp/xml/meson.build b/doc/cpp/xml/meson.build index 294cbf2..618d1b9 100644 --- a/doc/cpp/xml/meson.build +++ b/doc/cpp/xml/meson.build @@ -10,13 +10,16 @@ config = configuration_data() config.set('PUGL_SRCDIR', pugl_src_root) config.set('DOX_OUTPUT', meson.current_build_dir() / '..') -cpp_doxyfile = configure_file(configuration: config, - input: '../Doxyfile.in', - output: 'Doxyfile') +cpp_doxyfile = configure_file( + configuration: config, + input: '../Doxyfile.in', + output: 'Doxyfile', +) cpp_index_xml = custom_target( 'cpp-index.xml', command: [doxygen, '@INPUT0@'], input: [cpp_doxyfile] + c_header_files + cpp_header_files, - output: 'index.xml') + output: 'index.xml', +) diff --git a/examples/meson.build b/examples/meson.build index db93f64..f3ff764 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -114,11 +114,14 @@ else dependencies = [pugl_dep, stub_backend_dep] defines = [] - executable(target, source, - include_directories: includes, - c_args: example_defines + example_c_args + defines, - cpp_args: example_defines + example_cpp_args + defines, - dependencies: dependencies) + executable( + target, + source, + c_args: example_defines + example_c_args + defines, + cpp_args: example_defines + example_cpp_args + defines, + dependencies: dependencies, + include_directories: includes, + ) endforeach # Build GL examples @@ -139,11 +142,14 @@ else dependencies += [puglpp_dep] endif - executable(target, source, - include_directories: includes, - c_args: example_defines + example_c_args + defines, - cpp_args: example_defines + example_cpp_args + defines, - dependencies: dependencies) + executable( + target, + source, + c_args: example_defines + example_c_args + defines, + cpp_args: example_defines + example_cpp_args + defines, + dependencies: dependencies, + include_directories: includes, + ) endforeach endif @@ -151,10 +157,13 @@ else if cairo_dep.found() foreach example : cairo_examples target = example.split('.')[0] - executable(target, example, - include_directories: includes, - c_args: example_defines + example_c_args + cairo_args, - dependencies: [pugl_dep, cairo_backend_dep]) + executable( + target, + example, + c_args: example_defines + example_c_args + cairo_args, + dependencies: [pugl_dep, cairo_backend_dep], + include_directories: includes, + ) endforeach endif @@ -171,11 +180,14 @@ else defines += ['-D_POSIX_C_SOURCE=200809L'] endif - executable(target, source, - include_directories: includes, - c_args: example_defines + example_c_args + defines, - cpp_args: example_defines + example_cpp_args + defines, - dependencies: dependencies) + executable( + target, + source, + c_args: example_defines + example_c_args + defines, + cpp_args: example_defines + example_cpp_args + defines, + dependencies: dependencies, + include_directories: includes, + ) endforeach endif endif diff --git a/examples/pugl_cairo_demo.app/MacOS/meson.build b/examples/pugl_cairo_demo.app/MacOS/meson.build index 1b9740c..5a6941a 100644 --- a/examples/pugl_cairo_demo.app/MacOS/meson.build +++ b/examples/pugl_cairo_demo.app/MacOS/meson.build @@ -1,7 +1,8 @@ executable( 'pugl_cairo_demo', ['../../pugl_cairo_demo.c'], - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args + cairo_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, cairo_backend_dep]) + dependencies: [pugl_dep, cairo_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_clipboard_demo.app/MacOS/meson.build b/examples/pugl_clipboard_demo.app/MacOS/meson.build index 2f2ebb9..dc12e27 100644 --- a/examples/pugl_clipboard_demo.app/MacOS/meson.build +++ b/examples/pugl_clipboard_demo.app/MacOS/meson.build @@ -4,6 +4,7 @@ executable( 'pugl_clipboard_demo', '../../pugl_clipboard_demo.c', - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, - dependencies: [pugl_dep, gl_backend_dep]) + dependencies: [pugl_dep, gl_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_cpp_demo.app/MacOS/meson.build b/examples/pugl_cpp_demo.app/MacOS/meson.build index c32600d..5b9ba3b 100644 --- a/examples/pugl_cpp_demo.app/MacOS/meson.build +++ b/examples/pugl_cpp_demo.app/MacOS/meson.build @@ -1,7 +1,8 @@ executable( 'pugl_cpp_demo', '../../pugl_cpp_demo.cpp', - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [puglpp_dep, gl_backend_dep]) + dependencies: [puglpp_dep, gl_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_cursor_demo.app/MacOS/meson.build b/examples/pugl_cursor_demo.app/MacOS/meson.build index f812489..8ab6f6a 100644 --- a/examples/pugl_cursor_demo.app/MacOS/meson.build +++ b/examples/pugl_cursor_demo.app/MacOS/meson.build @@ -1,7 +1,8 @@ executable( 'pugl_cursor_demo', '../../pugl_cursor_demo.c', - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, gl_backend_dep]) + dependencies: [pugl_dep, gl_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_embed_demo.app/MacOS/meson.build b/examples/pugl_embed_demo.app/MacOS/meson.build index 75634ce..ba7f875 100644 --- a/examples/pugl_embed_demo.app/MacOS/meson.build +++ b/examples/pugl_embed_demo.app/MacOS/meson.build @@ -1,7 +1,8 @@ executable( 'pugl_embed_demo', '../../pugl_embed_demo.c', - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, gl_backend_dep]) + dependencies: [pugl_dep, gl_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_shader_demo.app/MacOS/meson.build b/examples/pugl_shader_demo.app/MacOS/meson.build index 998f2df..a2b0974 100644 --- a/examples/pugl_shader_demo.app/MacOS/meson.build +++ b/examples/pugl_shader_demo.app/MacOS/meson.build @@ -5,7 +5,8 @@ executable( '../../glad/glad.c', '../../pugl_shader_demo.c', ], - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, gl_backend_dep, dl_dep]) + dependencies: [pugl_dep, gl_backend_dep, dl_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build b/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build index b0f9ca0..b120b32 100644 --- a/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build +++ b/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build @@ -4,7 +4,8 @@ executable( '../../pugl_vulkan_cpp_demo.cpp', '../../file_utils.c', ], - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [puglpp_dep, vulkan_backend_dep]) + dependencies: [puglpp_dep, vulkan_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_vulkan_cpp_demo.app/meson.build b/examples/pugl_vulkan_cpp_demo.app/meson.build index 90b2329..58a943c 100644 --- a/examples/pugl_vulkan_cpp_demo.app/meson.build +++ b/examples/pugl_vulkan_cpp_demo.app/meson.build @@ -12,16 +12,20 @@ shaders = [ cp = find_program('../../scripts/cp.py') -custom_target('rect.vert.spv', - input: rect_vert_spv, - output: 'rect.vert.spv', - command: [cp, '@INPUT@', '@OUTPUT@'], - build_by_default: true) +custom_target( + 'rect.vert.spv', + build_by_default: true, + command: [cp, '@INPUT@', '@OUTPUT@'], + input: rect_vert_spv, + output: 'rect.vert.spv', +) -custom_target('rect.frag.spv', - input: rect_frag_spv, - output: 'rect.frag.spv', - command: [cp, '@INPUT@', '@OUTPUT@'], - build_by_default: true) +custom_target( + 'rect.frag.spv', + build_by_default: true, + command: [cp, '@INPUT@', '@OUTPUT@'], + input: rect_frag_spv, + output: 'rect.frag.spv', +) subdir('MacOS') diff --git a/examples/pugl_vulkan_demo.app/MacOS/meson.build b/examples/pugl_vulkan_demo.app/MacOS/meson.build index 61f3152..a6560a6 100644 --- a/examples/pugl_vulkan_demo.app/MacOS/meson.build +++ b/examples/pugl_vulkan_demo.app/MacOS/meson.build @@ -4,6 +4,7 @@ executable( '../../pugl_vulkan_demo.c', '../../file_utils.c', ], - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, - dependencies: [pugl_dep, vulkan_backend_dep]) + dependencies: [pugl_dep, vulkan_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/pugl_window_demo.app/MacOS/meson.build b/examples/pugl_window_demo.app/MacOS/meson.build index 5a9ff6a..729e1a4 100644 --- a/examples/pugl_window_demo.app/MacOS/meson.build +++ b/examples/pugl_window_demo.app/MacOS/meson.build @@ -1,7 +1,8 @@ executable( 'pugl_window_demo', '../../pugl_window_demo.c', - include_directories: include_directories('../../..'), c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, gl_backend_dep]) + dependencies: [pugl_dep, gl_backend_dep], + include_directories: include_directories('../../..'), +) diff --git a/examples/shaders/meson.build b/examples/shaders/meson.build index 9121e97..c96b70c 100644 --- a/examples/shaders/meson.build +++ b/examples/shaders/meson.build @@ -18,33 +18,41 @@ if vulkan_dep.found() cat = find_program('../../scripts/cat.py') glslang = find_program('glslangValidator') - rect_vulkan_vert = custom_target('rect.vulkan.vert', - output: 'rect.vulkan.vert', - input: ['header_420.glsl', 'rect.vert'], - command: [cat, '@INPUT@'], - build_by_default: true, - capture: true) - - rect_vulkan_frag = custom_target('rect.vulkan.frag', - output: 'rect.vulkan.frag', - input: ['header_420.glsl', 'rect.frag'], - command: [cat, '@INPUT@'], - build_by_default: true, - capture: true) + rect_vulkan_vert = custom_target( + 'rect.vulkan.vert', + build_by_default: true, + capture: true, + command: [cat, '@INPUT@'], + input: ['header_420.glsl', 'rect.vert'], + output: 'rect.vulkan.vert', + ) + + rect_vulkan_frag = custom_target( + 'rect.vulkan.frag', + build_by_default: true, + capture: true, + command: [cat, '@INPUT@'], + input: ['header_420.glsl', 'rect.frag'], + output: 'rect.vulkan.frag', + ) glslang_command = [glslang, '-V', '-o', '@OUTPUT@', '@INPUT@'] - rect_vert_spv = custom_target('rect.vert.spv', - output: 'rect.vert.spv', - input: rect_vulkan_vert, - command: glslang_command, - build_by_default: true, - install: false) - - rect_frag_spv = custom_target('rect.frag.spv', - output: 'rect.frag.spv', - input: rect_vulkan_frag, - command: glslang_command, - build_by_default: true, - install: false) + rect_vert_spv = custom_target( + 'rect.vert.spv', + build_by_default: true, + command: glslang_command, + input: rect_vulkan_vert, + install: false, + output: 'rect.vert.spv', + ) + + rect_frag_spv = custom_target( + 'rect.frag.spv', + build_by_default: true, + command: glslang_command, + input: rect_vulkan_frag, + install: false, + output: 'rect.frag.spv', + ) endif diff --git a/meson.build b/meson.build index b1d3993..309348e 100644 --- a/meson.build +++ b/meson.build @@ -65,9 +65,13 @@ if host_machine.system() == 'darwin' core_deps = [cocoa_dep, corevideo_dep] extension = '.m' - add_project_arguments(['-Wno-deprecated-declarations'], language: ['c', 'objc']) - add_project_arguments(['-DGL_SILENCE_DEPRECATION'], language: ['c', 'objc']) - add_project_link_arguments(['-Wl,-framework,Cocoa'], language: ['c', 'objc']) + platform_suppressions = [ + '-DGL_SILENCE_DEPRECATION', + '-Wl,-framework,Cocoa', + '-Wno-deprecated-declarations', + ] + + add_project_arguments(platform_suppressions, language: ['c', 'objc']) # Windows elif host_machine.system() == 'windows' @@ -158,24 +162,29 @@ common_sources = files( libpugl = build_target( core_name, common_sources + platform_sources, - version: meson.project_version(), - include_directories: includes, c_args: library_args + core_args, dependencies: core_deps, gnu_symbol_visibility: 'hidden', + include_directories: includes, install: true, - target_type: library_type) + target_type: library_type, + version: meson.project_version(), +) -pugl_dep = declare_dependency(link_with: libpugl, - dependencies: core_deps, - include_directories: ['include']) +pugl_dep = declare_dependency( + dependencies: core_deps, + include_directories: ['include'], + link_with: libpugl, +) -pkg.generate(libpugl, - name: 'Pugl', - filebase: versioned_name, - subdirs: [versioned_name], - version: meson.project_version(), - description: 'Pugl GUI library core') +pkg.generate( + libpugl, + description: 'Pugl GUI library core', + filebase: versioned_name, + name: 'Pugl', + subdirs: [versioned_name], + version: meson.project_version(), +) ############ # Backends # @@ -186,24 +195,31 @@ if get_option('stub') name = 'pugl_' + platform + '_stub' + version_suffix sources = files('src/' + platform + '_stub' + extension) - stub_backend = build_target(name, sources, - version: meson.project_version(), - include_directories: includes, - c_args: library_args, - dependencies: [pugl_dep], - gnu_symbol_visibility: 'hidden', - install: true, - target_type: library_type) - - stub_backend_dep = declare_dependency(link_with: stub_backend, - dependencies: [pugl_dep]) - - pkg.generate(stub_backend, - name: 'Pugl Stub', - filebase: 'pugl-stub-@0@'.format(major_version), - subdirs: [versioned_name], - version: meson.project_version(), - description: 'Native window pugl graphics backend') + stub_backend = build_target( + name, + sources, + c_args: library_args, + dependencies: [pugl_dep], + gnu_symbol_visibility: 'hidden', + include_directories: includes, + install: true, + target_type: library_type, + version: meson.project_version(), + ) + + stub_backend_dep = declare_dependency( + link_with: stub_backend, + dependencies: [pugl_dep], + ) + + pkg.generate( + stub_backend, + description: 'Native window pugl graphics backend', + filebase: 'pugl-stub-@0@'.format(major_version), + name: 'Pugl Stub', + subdirs: [versioned_name], + version: meson.project_version(), + ) endif # OpenGL @@ -212,24 +228,31 @@ if opengl_dep.found() name = 'pugl_' + platform + '_gl' + version_suffix sources = files('src/' + platform + '_gl' + extension) - gl_backend = build_target(name, sources, - version: meson.project_version(), - include_directories: includes, - c_args: library_args, - dependencies: [pugl_dep, opengl_dep], - gnu_symbol_visibility: 'hidden', - install: true, - target_type: library_type) - - gl_backend_dep = declare_dependency(link_with: gl_backend, - dependencies: [pugl_dep, opengl_dep]) - - pkg.generate(gl_backend, - name: 'Pugl OpenGL', - filebase: 'pugl-gl-@0@'.format(major_version), - subdirs: [versioned_name], - version: meson.project_version(), - description: 'Pugl GUI library with OpenGL backend') + gl_backend = build_target( + name, + sources, + c_args: library_args, + dependencies: [pugl_dep, opengl_dep], + gnu_symbol_visibility: 'hidden', + include_directories: includes, + install: true, + target_type: library_type, + version: meson.project_version(), + ) + + gl_backend_dep = declare_dependency( + link_with: gl_backend, + dependencies: [pugl_dep, opengl_dep], + ) + + pkg.generate( + gl_backend, + description: 'Pugl GUI library with OpenGL backend', + filebase: 'pugl-gl-@0@'.format(major_version), + name: 'Pugl OpenGL', + subdirs: [versioned_name], + version: meson.project_version(), + ) endif # Cairo @@ -249,25 +272,32 @@ if cairo_dep.found() cairo_args = cc.get_supported_arguments(cairo_args) - cairo_backend = build_target(name, sources, - version: meson.project_version(), - include_directories: includes, - c_args: library_args + cairo_args, - objc_args: library_args + cairo_args, - dependencies: [pugl_dep, cairo_dep], - gnu_symbol_visibility: 'hidden', - install: true, - target_type: library_type) - - cairo_backend_dep = declare_dependency(link_with: cairo_backend, - dependencies: [pugl_dep, cairo_dep]) - - pkg.generate(cairo_backend, - name: 'Pugl Cairo', - filebase: 'pugl-cairo-@0@'.format(major_version), - subdirs: [versioned_name], - version: meson.project_version(), - description: 'Pugl GUI library with Cairo backend') + cairo_backend = build_target( + name, + sources, + c_args: library_args + cairo_args, + dependencies: [pugl_dep, cairo_dep], + gnu_symbol_visibility: 'hidden', + include_directories: includes, + install: true, + objc_args: library_args + cairo_args, + target_type: library_type, + version: meson.project_version(), + ) + + cairo_backend_dep = declare_dependency( + dependencies: [pugl_dep, cairo_dep], + link_with: cairo_backend, + ) + + pkg.generate( + cairo_backend, + description: 'Pugl GUI library with Cairo backend', + filebase: 'pugl-cairo-@0@'.format(major_version), + name: 'Pugl Cairo', + subdirs: [versioned_name], + version: meson.project_version(), + ) endif # Vulkan @@ -288,25 +318,31 @@ if vulkan_dep.found() ] endif - vulkan_backend = build_target(name, sources, - version: meson.project_version(), - include_directories: includes, - c_args: library_args, - dependencies: vulkan_deps, - gnu_symbol_visibility: 'hidden', - install: true, - target_type: library_type) + vulkan_backend = build_target( + name, + sources, + c_args: library_args, + dependencies: vulkan_deps, + gnu_symbol_visibility: 'hidden', + include_directories: includes, + install: true, + target_type: library_type, + version: meson.project_version(), + ) vulkan_backend_dep = declare_dependency( + dependencies: [pugl_dep, vulkan_dep, thread_dep], link_with: vulkan_backend, - dependencies: [pugl_dep, vulkan_dep, thread_dep]) - - pkg.generate(vulkan_backend, - name: 'Pugl Vulkan', - filebase: 'pugl-vulkan-@0@'.format(major_version), - subdirs: [versioned_name], - version: meson.project_version(), - description: 'Pugl GUI library with Vulkan backend') + ) + + pkg.generate( + vulkan_backend, + description: 'Pugl GUI library with Vulkan backend', + filebase: 'pugl-vulkan-@0@'.format(major_version), + name: 'Pugl Vulkan', + subdirs: [versioned_name], + version: meson.project_version(), + ) endif ############################### diff --git a/test/meson.build b/test/meson.build index efa976a..eec5cf4 100644 --- a/test/meson.build +++ b/test/meson.build @@ -74,45 +74,65 @@ includes = [ ] foreach test : basic_tests - test(test, - executable('test_' + test, 'test_@0@.c'.format(test), - c_args: test_c_args, - include_directories: include_directories(includes), - dependencies: [pugl_dep, stub_backend_dep]), - suite: 'unit') + test( + test, + executable( + 'test_' + test, + 'test_@0@.c'.format(test), + c_args: test_c_args, + dependencies: [pugl_dep, stub_backend_dep], + include_directories: include_directories(includes), + ), + suite: 'unit', + ) endforeach if opengl_dep.found() foreach test : gl_tests - test(test, - executable('test_' + test, 'test_@0@.c'.format(test), - c_args: test_c_args, - include_directories: include_directories(includes), - dependencies: [pugl_dep, gl_backend_dep]), - suite: 'unit') + test( + test, + executable( + 'test_' + test, + 'test_@0@.c'.format(test), + c_args: test_c_args, + dependencies: [pugl_dep, gl_backend_dep], + include_directories: include_directories(includes), + ), + suite: 'unit', + ) endforeach endif if cairo_dep.found() foreach test : cairo_tests - test(test, - executable('test_' + test, 'test_@0@.c'.format(test), - c_args: test_c_args + cairo_args, - include_directories: include_directories(includes), - dependencies: [pugl_dep, cairo_backend_dep]), - suite: 'unit') + test( + test, + executable( + 'test_' + test, + 'test_@0@.c'.format(test), + c_args: test_c_args + cairo_args, + dependencies: [pugl_dep, cairo_backend_dep], + include_directories: include_directories(includes), + ), + suite: 'unit', + ) endforeach endif if vulkan_dep.found() foreach test : vulkan_tests - test(test, - executable('test_' + test, 'test_@0@.c'.format(test), - c_args: test_c_args, - cpp_args: test_cpp_args, - include_directories: include_directories(includes), - dependencies: [pugl_dep, vulkan_backend_dep]), - suite: 'unit') + test( + test, + executable( + 'test_' + test, + 'test_@0@.c'.format(test), + c_args: test_c_args, + cpp_args: test_cpp_args, + dependencies: [pugl_dep, vulkan_backend_dep], + include_directories: include_directories(includes), + ), + suite: 'unit', + ) endforeach endif @@ -151,10 +171,13 @@ if host_machine.system() == 'darwin' unified_args += objcpp.get_supported_arguments( test_cpp_args + objcpp_args) - executable('inline_objcpp', 'test_inline_objcpp.mm', - include_directories: include_directories(includes), - dependencies: unified_deps, - objcpp_args: unified_args) + executable( + 'inline_objcpp', + 'test_inline_objcpp.mm', + dependencies: unified_deps, + include_directories: include_directories(includes), + objcpp_args: unified_args, + ) elif is_variable('cpp') unified_args = [] @@ -180,8 +203,11 @@ elif is_variable('cpp') ] endif - executable('inline_cpp', 'test_inline_cpp.cpp', - include_directories: include_directories(includes), - dependencies: unified_deps, - cpp_args: test_cpp_args + unified_args) + executable( + 'inline_cpp', + 'test_inline_cpp.cpp', + cpp_args: test_cpp_args + unified_args, + dependencies: unified_deps, + include_directories: include_directories(includes), + ) endif |