diff --git a/src/meson.build b/src/meson.build index d54d9d7..75770f7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -32,6 +32,8 @@ vkBasalt_src = [ 'reshade_uniforms.cpp', 'sampler.cpp', 'shader.cpp', + 'stb_image.c', + 'stb_image_resize.c', 'util.cpp', 'vkdispatch.cpp', ] @@ -45,19 +47,13 @@ conf_paths.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('da configure_file(output: 'config_paths.hpp', configuration : conf_paths) -# Compile stb_image implementations separatelly. -# This allows to build project with Meson --unity=on option, for faster compilation -# and potentially better optimization. -stb_image_lib = static_library('stb_image', 'stb_image.c') -stb_image_resize_lib = static_library('stb_image_resize', 'stb_image_resize.c') - # X11/X.h library contains many definitions (e.g. None) # which conflicts with the rest codebase with with Meson --unity=on option keyboard_input_x11_lib = static_library('keyboard_input_x11', 'keyboard_input_x11.cpp') shared_library(meson.project_name().to_lower(), vkBasalt_src, shader_include, - link_with: [ stb_image_lib, stb_image_resize_lib, keyboard_input_x11_lib ], + link_with: [keyboard_input_x11_lib], include_directories : vkBasalt_include_path, dependencies : [x11_dep, reshade_dep], install : true, diff --git a/src/stb_image.c b/src/stb_image.c index 52cc76b..66f9ed2 100644 --- a/src/stb_image.c +++ b/src/stb_image.c @@ -2,3 +2,6 @@ #define STB_IMAGE_DDS_IMPLEMENTATION #include "stb_image.h" #include "stb_image_dds.h" + +#undef STB_IMAGE_IMPLEMENTATION +#undef STB_IMAGE_DDS_IMPLEMENTATION diff --git a/src/stb_image_resize.c b/src/stb_image_resize.c index b2d4775..aea8b1e 100644 --- a/src/stb_image_resize.c +++ b/src/stb_image_resize.c @@ -1,2 +1,4 @@ #define STB_IMAGE_RESIZE_IMPLEMENTATION #include "stb_image_resize.h" + +#undef STB_IMAGE_RESIZE_IMPLEMENTATION