From 1e70770b5eaee533643d1c80c94ae9aa8393427e Mon Sep 17 00:00:00 2001 From: ijuintekka Date: Fri, 13 Oct 2023 08:04:24 +0100 Subject: [PATCH 1/5] Update meson.build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 487b65b0..fa31ab74 100755 --- a/src/meson.build +++ b/src/meson.build @@ -8,7 +8,7 @@ sdl2 = dependency('SDL2', static: build_static) sdl_sound = compilers['cpp'].find_library('SDL2_sound') sdl2_ttf = dependency('SDL2_ttf', static: build_static) freetype = dependency('freetype2', static: build_static) -sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static']) +sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake') pixman = dependency('pixman-1', static: build_static) png = dependency('libpng', static: build_static) zlib = dependency('zlib', static: build_static) From 6e0611d287e14d1830e1de8c91f2833b60afd1e7 Mon Sep 17 00:00:00 2001 From: ijuintekka Date: Fri, 13 Oct 2023 08:57:57 +0100 Subject: [PATCH 2/5] Update meson.build --- src/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/meson.build b/src/meson.build index fa31ab74..5b236789 100755 --- a/src/meson.build +++ b/src/meson.build @@ -8,6 +8,8 @@ sdl2 = dependency('SDL2', static: build_static) sdl_sound = compilers['cpp'].find_library('SDL2_sound') sdl2_ttf = dependency('SDL2_ttf', static: build_static) freetype = dependency('freetype2', static: build_static) +# As currently no pkg-config file is generated for sdl2_image, and pkg-config is the default option for meson detecting dependencies, pkg-config will fail to find sdl2_image.pc in the build's lib/pkgconfig folder and instead pull it from the locally installed packages if it exists. +# Changing the dependency search method to cmake allows meson to prioritize the version of sdl2_image we are building instead. sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake') pixman = dependency('pixman-1', static: build_static) png = dependency('libpng', static: build_static) From c01b2cbd92925050ee5c596f64bc1e33c870d40a Mon Sep 17 00:00:00 2001 From: ijuintekka Date: Sun, 15 Oct 2023 21:22:31 +0100 Subject: [PATCH 3/5] Update meson.build --- src/meson.build | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/meson.build b/src/meson.build index 5b236789..979fb238 100755 --- a/src/meson.build +++ b/src/meson.build @@ -8,14 +8,21 @@ sdl2 = dependency('SDL2', static: build_static) sdl_sound = compilers['cpp'].find_library('SDL2_sound') sdl2_ttf = dependency('SDL2_ttf', static: build_static) freetype = dependency('freetype2', static: build_static) -# As currently no pkg-config file is generated for sdl2_image, and pkg-config is the default option for meson detecting dependencies, pkg-config will fail to find sdl2_image.pc in the build's lib/pkgconfig folder and instead pull it from the locally installed packages if it exists. -# Changing the dependency search method to cmake allows meson to prioritize the version of sdl2_image we are building instead. -sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake') pixman = dependency('pixman-1', static: build_static) png = dependency('libpng', static: build_static) zlib = dependency('zlib', static: build_static) uchardet = dependency('uchardet', static: build_static) +# As no pkg-config file is generated for sdl2_image, and pkg-config is the default option for meson detecting dependencies, pkg-config will fail to find sdl2_image.pc in the build's lib/pkgconfig folder and instead pull it from the locally installed packages if it exists. +# We should first check to see if cmake can find our sdl2_image sub project and use that, then check using pkg-config as normal if we are not building the sub project. +sdl2_image_cmake = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake', required: false) +sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static) +if sdl2_image_cmake.found() == true + global_dependencies += [sdl2_image_cmake] +else + global_dependencies += [sdl2_image] +endif + if host_system == 'windows' bz2 = dependency('bzip2', static: build_static) iconv = compilers['cpp'].find_library('iconv', static: build_static) @@ -84,7 +91,7 @@ global_include_dirs += include_directories('.', 'util', 'util/sigslot', 'util/sigslot/adapter' ) -global_dependencies += [openal, zlib, bz2, sdl2, sdl_sound, pixman, physfs, theora, vorbisfile, vorbis, ogg, sdl2_ttf, freetype, sdl2_image, png, iconv, uchardet] +global_dependencies += [openal, zlib, bz2, sdl2, sdl_sound, pixman, physfs, theora, vorbisfile, vorbis, ogg, sdl2_ttf, freetype, png, iconv, uchardet] if host_system == 'windows' global_dependencies += compilers['cpp'].find_library('wsock32') endif From f42f6c5dcf3b71a8bf2be2d871fa659b721129ec Mon Sep 17 00:00:00 2001 From: ijuintekka Date: Sun, 15 Oct 2023 21:42:26 +0100 Subject: [PATCH 4/5] Update meson.build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 979fb238..1bab5240 100755 --- a/src/meson.build +++ b/src/meson.build @@ -16,10 +16,10 @@ uchardet = dependency('uchardet', static: build_static) # As no pkg-config file is generated for sdl2_image, and pkg-config is the default option for meson detecting dependencies, pkg-config will fail to find sdl2_image.pc in the build's lib/pkgconfig folder and instead pull it from the locally installed packages if it exists. # We should first check to see if cmake can find our sdl2_image sub project and use that, then check using pkg-config as normal if we are not building the sub project. sdl2_image_cmake = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake', required: false) -sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static) if sdl2_image_cmake.found() == true global_dependencies += [sdl2_image_cmake] else + sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static) global_dependencies += [sdl2_image] endif From d26fa631ba9b8d76751ed50157145c61eb9b2abe Mon Sep 17 00:00:00 2001 From: ijuintekka Date: Sun, 15 Oct 2023 22:10:59 +0100 Subject: [PATCH 5/5] Update meson.build --- src/meson.build | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/meson.build b/src/meson.build index 1bab5240..9439999f 100755 --- a/src/meson.build +++ b/src/meson.build @@ -15,12 +15,9 @@ uchardet = dependency('uchardet', static: build_static) # As no pkg-config file is generated for sdl2_image, and pkg-config is the default option for meson detecting dependencies, pkg-config will fail to find sdl2_image.pc in the build's lib/pkgconfig folder and instead pull it from the locally installed packages if it exists. # We should first check to see if cmake can find our sdl2_image sub project and use that, then check using pkg-config as normal if we are not building the sub project. -sdl2_image_cmake = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake', required: false) -if sdl2_image_cmake.found() == true - global_dependencies += [sdl2_image_cmake] -else +sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static, method: 'cmake', required: false) +if sdl2_image.found() == false sdl2_image = dependency('SDL2_image', modules: ['SDL2_image::SDL2_image-static', 'SDL2_image::brotlidec-static', 'SDL2_image::brotlicommon-static', 'SDL2_image::hwy', 'SDL2_image::jxl_dec-static'], static: build_static) - global_dependencies += [sdl2_image] endif if host_system == 'windows' @@ -91,7 +88,7 @@ global_include_dirs += include_directories('.', 'util', 'util/sigslot', 'util/sigslot/adapter' ) -global_dependencies += [openal, zlib, bz2, sdl2, sdl_sound, pixman, physfs, theora, vorbisfile, vorbis, ogg, sdl2_ttf, freetype, png, iconv, uchardet] +global_dependencies += [openal, zlib, bz2, sdl2, sdl_sound, pixman, physfs, theora, vorbisfile, vorbis, ogg, sdl2_ttf, freetype, sdl2_image, png, iconv, uchardet] if host_system == 'windows' global_dependencies += compilers['cpp'].find_library('wsock32') endif