diff options
author | David Robillard <d@drobilla.net> | 2025-02-07 15:34:54 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-07 15:34:54 -0500 |
commit | da301d48c6d519fb2020573c6a501a0c43f9064c (patch) | |
tree | e0b861e2cc3fd31503342a007c21f98110d086f0 /examples | |
parent | 914e9086ef45031903cec79b12b20065ae3cac96 (diff) | |
download | pugl-da301d48c6d519fb2020573c6a501a0c43f9064c.tar.gz pugl-da301d48c6d519fb2020573c6a501a0c43f9064c.tar.bz2 pugl-da301d48c6d519fb2020573c6a501a0c43f9064c.zip |
Move test utilities to a separate subproject
Towards sorting out sloppy include directories, and avoiding upward-relative
paths in includes. A subproject seems like overkill, but this is the only way
I can think of that makes for a clean local dependency that doesn't rely on
anything non-standard or trigger any linters.
Diffstat (limited to 'examples')
22 files changed, 33 insertions, 27 deletions
diff --git a/examples/meson.build b/examples/meson.build index ef77e65..8206a10 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -28,7 +28,6 @@ vulkan_examples = [ ] includes = include_directories( - '..', '../bindings/cpp/include', '../include', ) @@ -120,7 +119,7 @@ else foreach example : stub_examples source = [example] target = example.split('.')[0] - dependencies = [pugl_dep, pugl_stub_dep] + dependencies = [pugl_dep, pugl_stub_dep, puglutil_dep] defines = [] executable( @@ -138,7 +137,7 @@ else foreach example : gl_examples source = [example] target = example.split('.')[0] - dependencies = [pugl_dep, pugl_gl_dep] + dependencies = [pugl_dep, pugl_gl_dep, puglutil_dep] defines = [] if target == 'pugl_shader_demo' @@ -174,7 +173,7 @@ else target, example, c_args: example_defines + example_c_args + cairo_args, - dependencies: [pugl_dep, pugl_cairo_dep], + dependencies: [pugl_dep, pugl_cairo_dep, puglutil_dep], include_directories: includes, ) endforeach @@ -185,7 +184,7 @@ else foreach example : vulkan_examples source = [example] target = example.split('.')[0] - dependencies = [dl_dep, pugl_vulkan_dep] + dependencies = [dl_dep, pugl_vulkan_dep, puglutil_dep] defines = [] if target == 'pugl_vulkan_cpp_demo' diff --git a/examples/pugl_cairo_demo.app/MacOS/meson.build b/examples/pugl_cairo_demo.app/MacOS/meson.build index 18e1fcf..66221c7 100644 --- a/examples/pugl_cairo_demo.app/MacOS/meson.build +++ b/examples/pugl_cairo_demo.app/MacOS/meson.build @@ -6,6 +6,6 @@ executable( ['../../pugl_cairo_demo.c'], c_args: example_defines + example_c_args + cairo_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, pugl_cairo_dep], + dependencies: [pugl_dep, pugl_cairo_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_cairo_demo.c b/examples/pugl_cairo_demo.c index 143f49e..1c16a93 100644 --- a/examples/pugl_cairo_demo.c +++ b/examples/pugl_cairo_demo.c @@ -2,7 +2,8 @@ // SPDX-License-Identifier: ISC #include "demo_utils.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "pugl/cairo.h" #include "pugl/pugl.h" diff --git a/examples/pugl_clipboard_demo.app/MacOS/meson.build b/examples/pugl_clipboard_demo.app/MacOS/meson.build index 31ad2f0..0727404 100644 --- a/examples/pugl_clipboard_demo.app/MacOS/meson.build +++ b/examples/pugl_clipboard_demo.app/MacOS/meson.build @@ -5,6 +5,5 @@ executable( 'pugl_clipboard_demo', '../../pugl_clipboard_demo.c', c_args: example_defines + example_c_args, - dependencies: [pugl_dep, pugl_gl_dep], - include_directories: include_directories('../../..'), + dependencies: [pugl_dep, pugl_gl_dep, puglutil_dep], ) diff --git a/examples/pugl_clipboard_demo.c b/examples/pugl_clipboard_demo.c index 706d32a..2f1fdbe 100644 --- a/examples/pugl_clipboard_demo.c +++ b/examples/pugl_clipboard_demo.c @@ -4,7 +4,8 @@ // A demonstration of using clipboards for copy/paste and drag and drop #include "cube_view.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "pugl/gl.h" #include "pugl/pugl.h" diff --git a/examples/pugl_cpp_demo.app/MacOS/meson.build b/examples/pugl_cpp_demo.app/MacOS/meson.build index f5ddd67..b840771 100644 --- a/examples/pugl_cpp_demo.app/MacOS/meson.build +++ b/examples/pugl_cpp_demo.app/MacOS/meson.build @@ -6,6 +6,6 @@ executable( '../../pugl_cpp_demo.cpp', c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [puglpp_dep, pugl_gl_dep], + dependencies: [puglpp_dep, pugl_gl_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_cpp_demo.cpp b/examples/pugl_cpp_demo.cpp index 6b52d18..37efe45 100644 --- a/examples/pugl_cpp_demo.cpp +++ b/examples/pugl_cpp_demo.cpp @@ -3,7 +3,8 @@ #include "cube_view.h" #include "demo_utils.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "pugl/gl.hpp" #include "pugl/pugl.h" diff --git a/examples/pugl_cursor_demo.app/MacOS/meson.build b/examples/pugl_cursor_demo.app/MacOS/meson.build index 94359cd..54670ad 100644 --- a/examples/pugl_cursor_demo.app/MacOS/meson.build +++ b/examples/pugl_cursor_demo.app/MacOS/meson.build @@ -6,6 +6,6 @@ executable( '../../pugl_cursor_demo.c', c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, pugl_gl_dep], + dependencies: [pugl_dep, pugl_gl_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_cursor_demo.c b/examples/pugl_cursor_demo.c index 8ae7631..a70a5eb 100644 --- a/examples/pugl_cursor_demo.c +++ b/examples/pugl_cursor_demo.c @@ -1,7 +1,7 @@ // Copyright 2012-2020 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "test/test_utils.h" +#include "puglutil/test_utils.h" #include "pugl/gl.h" #include "pugl/pugl.h" diff --git a/examples/pugl_embed_demo.app/MacOS/meson.build b/examples/pugl_embed_demo.app/MacOS/meson.build index 9e6dd58..3bef9c1 100644 --- a/examples/pugl_embed_demo.app/MacOS/meson.build +++ b/examples/pugl_embed_demo.app/MacOS/meson.build @@ -6,6 +6,6 @@ executable( '../../pugl_embed_demo.c', c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, pugl_gl_dep], + dependencies: [pugl_dep, pugl_gl_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_embed_demo.c b/examples/pugl_embed_demo.c index 417e690..ff6a63e 100644 --- a/examples/pugl_embed_demo.c +++ b/examples/pugl_embed_demo.c @@ -3,7 +3,8 @@ #include "cube_view.h" #include "demo_utils.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "pugl/gl.h" #include "pugl/pugl.h" diff --git a/examples/pugl_management_demo.app/MacOS/meson.build b/examples/pugl_management_demo.app/MacOS/meson.build index 69dafc7..31604f6 100644 --- a/examples/pugl_management_demo.app/MacOS/meson.build +++ b/examples/pugl_management_demo.app/MacOS/meson.build @@ -6,6 +6,6 @@ executable( ['../../pugl_management_demo.c'], c_args: example_defines + example_c_args + cairo_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, pugl_cairo_dep], + dependencies: [pugl_dep, pugl_cairo_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_management_demo.c b/examples/pugl_management_demo.c index 163e063..156b2dd 100644 --- a/examples/pugl_management_demo.c +++ b/examples/pugl_management_demo.c @@ -5,7 +5,7 @@ A demonstration of window types, states, and management. */ -#include "test/test_utils.h" +#include "puglutil/test_utils.h" #include "pugl/cairo.h" #include "pugl/pugl.h" diff --git a/examples/pugl_print_events.c b/examples/pugl_print_events.c index 96a8889..7f5fe21 100644 --- a/examples/pugl_print_events.c +++ b/examples/pugl_print_events.c @@ -1,7 +1,7 @@ // Copyright 2012-2020 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "test/test_utils.h" +#include "puglutil/test_utils.h" #include "pugl/pugl.h" #include "pugl/stub.h" diff --git a/examples/pugl_shader_demo.app/MacOS/meson.build b/examples/pugl_shader_demo.app/MacOS/meson.build index d3d0755..9507e17 100644 --- a/examples/pugl_shader_demo.app/MacOS/meson.build +++ b/examples/pugl_shader_demo.app/MacOS/meson.build @@ -10,6 +10,6 @@ executable( ], c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, pugl_gl_dep, dl_dep], + dependencies: [pugl_dep, pugl_gl_dep, dl_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_shader_demo.c b/examples/pugl_shader_demo.c index c05a9dd..209e8bd 100644 --- a/examples/pugl_shader_demo.c +++ b/examples/pugl_shader_demo.c @@ -25,7 +25,8 @@ #include "file_utils.h" #include "rects.h" #include "shader_utils.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "glad/glad.h" diff --git a/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build b/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build index d75c75d..08078a0 100644 --- a/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build +++ b/examples/pugl_vulkan_cpp_demo.app/MacOS/meson.build @@ -9,6 +9,6 @@ executable( ], c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [puglpp_dep, pugl_vulkan_dep], + dependencies: [puglpp_dep, pugl_vulkan_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_vulkan_cpp_demo.cpp b/examples/pugl_vulkan_cpp_demo.cpp index 52976e6..16f9778 100644 --- a/examples/pugl_vulkan_cpp_demo.cpp +++ b/examples/pugl_vulkan_cpp_demo.cpp @@ -17,7 +17,8 @@ #include "demo_utils.h" #include "file_utils.h" #include "rects.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "sybok.hpp" diff --git a/examples/pugl_vulkan_demo.app/MacOS/meson.build b/examples/pugl_vulkan_demo.app/MacOS/meson.build index 0d07171..172b8a4 100644 --- a/examples/pugl_vulkan_demo.app/MacOS/meson.build +++ b/examples/pugl_vulkan_demo.app/MacOS/meson.build @@ -8,6 +8,6 @@ executable( '../../file_utils.c', ], c_args: example_defines + example_c_args, - dependencies: [pugl_dep, pugl_vulkan_dep], + dependencies: [pugl_dep, pugl_vulkan_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_vulkan_demo.c b/examples/pugl_vulkan_demo.c index 708a28f..6b9f03d 100644 --- a/examples/pugl_vulkan_demo.c +++ b/examples/pugl_vulkan_demo.c @@ -10,7 +10,8 @@ */ #include "demo_utils.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "pugl/pugl.h" #include "pugl/vulkan.h" diff --git a/examples/pugl_window_demo.app/MacOS/meson.build b/examples/pugl_window_demo.app/MacOS/meson.build index 7bfc219..d1f7b98 100644 --- a/examples/pugl_window_demo.app/MacOS/meson.build +++ b/examples/pugl_window_demo.app/MacOS/meson.build @@ -6,6 +6,6 @@ executable( '../../pugl_window_demo.c', c_args: example_defines + example_c_args, cpp_args: example_defines + example_cpp_args, - dependencies: [pugl_dep, pugl_gl_dep], + dependencies: [pugl_dep, pugl_gl_dep, puglutil_dep], include_directories: include_directories('../../..'), ) diff --git a/examples/pugl_window_demo.c b/examples/pugl_window_demo.c index 6ae6f8b..757c0f9 100644 --- a/examples/pugl_window_demo.c +++ b/examples/pugl_window_demo.c @@ -7,7 +7,8 @@ #include "cube_view.h" #include "demo_utils.h" -#include "test/test_utils.h" + +#include "puglutil/test_utils.h" #include "pugl/gl.h" #include "pugl/pugl.h" |