diff options
author | David Robillard <d@drobilla.net> | 2022-04-22 16:42:41 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-04-23 21:18:56 -0400 |
commit | adc8d07a210adcea86024121b53f28170141dae4 (patch) | |
tree | 32e7ac406504eea060456261bad8223cc7c706e2 /examples | |
parent | c7c45e1b7b32cb8a9cab173138e9ab7dedff2b12 (diff) | |
download | pugl-adc8d07a210adcea86024121b53f28170141dae4.tar.gz pugl-adc8d07a210adcea86024121b53f28170141dae4.tar.bz2 pugl-adc8d07a210adcea86024121b53f28170141dae4.zip |
Move reserved platform defines from code to build system
Numerous things warn about this, and it's generally a bad idea to put these in
the code since it can result in incompatibly compiled code being linked
together. Unfortunately this makes building manually (without the build
system) more fiddly, but such is life.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/file_utils.c | 4 | ||||
-rw-r--r-- | examples/meson.build | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/examples/file_utils.c b/examples/file_utils.c index 3b7c530..f769dc6 100644 --- a/examples/file_utils.c +++ b/examples/file_utils.c @@ -1,10 +1,6 @@ // Copyright 2019-2020 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#if !defined(__APPLE__) && !defined(_GNU_SOURCE) -# define _GNU_SOURCE -#endif - #include "file_utils.h" #ifdef _WIN32 diff --git a/examples/meson.build b/examples/meson.build index b952c6b..d57fea4 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -34,6 +34,7 @@ if get_option('strict') example_c_args += [ '-Wno-float-equal', '-Wno-padded', + '-Wno-reserved-id-macro', ] elif cc.get_id() == 'gcc' example_c_args += [ @@ -54,7 +55,6 @@ if is_variable('cpp') '-Wno-documentation-unknown-command', # Cairo '-Wno-old-style-cast', '-Wno-padded', - '-Wno-reserved-id-macro', '-Wno-switch-enum', ] elif cpp.get_id() == 'gcc' @@ -80,18 +80,20 @@ if opengl_dep.found() source = [example] target = example.split('.')[0] dependencies = [gl_backend_dep] + defines = [] if target == 'pugl_shader_demo' source += ['file_utils.c', 'glad/glad.c'] dependencies += [dl_dep] + defines += ['-D_POSIX_C_SOURCE=200809L'] elif target == 'pugl_print_events' dependencies += [stub_backend_dep] endif executable(target, source, include_directories: includes, - c_args: example_defines + example_c_args, - cpp_args: example_defines + example_cpp_args, + c_args: example_defines + example_c_args + defines, + cpp_args: example_defines + example_cpp_args + defines, dependencies: dependencies) endforeach endif @@ -113,15 +115,17 @@ if vulkan_dep.found() source = [example] target = example.split('.')[0] dependencies = [dl_dep, vulkan_backend_dep] + defines = [] if target == 'pugl_vulkan_cpp_demo' source += ['file_utils.c'] + defines += ['-D_POSIX_C_SOURCE=200809L'] endif executable(target, source, include_directories: includes, - c_args: example_defines + example_c_args, - cpp_args: example_defines + example_cpp_args, + c_args: example_defines + example_c_args + defines, + cpp_args: example_defines + example_cpp_args + defines, dependencies: dependencies) endforeach endif |