aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2023-04-11 10:21:55 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-04-24 11:41:55 -0400
commit09ec4f6e225fb1634a800a58c28a87fe3733b343 (patch)
tree622cbdfb543fbc3bfced2efd71914d296460a4df
parent18cfa545f03ddb6cb8378fdadec4f284aa7ea221 (diff)
downloadmeson-09ec4f6e225fb1634a800a58c28a87fe3733b343.zip
meson-09ec4f6e225fb1634a800a58c28a87fe3733b343.tar.gz
meson-09ec4f6e225fb1634a800a58c28a87fe3733b343.tar.bz2
dependencies: allow to fallback on CMake to find the SDL2 library
On Windows, the SDL2 library is generally provided with only CMake config files. This commit allows meson to fallback on CMake as a last resort to find the SDL2 library.
-rw-r--r--docs/markdown/Dependencies.md6
-rw-r--r--mesonbuild/dependencies/ui.py3
-rw-r--r--test cases/frameworks/16 sdl2/meson_options.txt2
-rw-r--r--test cases/frameworks/16 sdl2/test.json3
4 files changed, 8 insertions, 6 deletions
diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md
index 356b181..29894ac 100644
--- a/docs/markdown/Dependencies.md
+++ b/docs/markdown/Dependencies.md
@@ -728,10 +728,10 @@ your own risk.
## SDL2
SDL2 can be located using `pkg-confg`, the `sdl2-config` config tool,
-or as an OSX framework.
+as an OSX framework, or `cmake`.
-`method` may be `auto`, `config-tool`, `extraframework` or
-`pkg-config`.
+`method` may be `auto`, `config-tool`, `extraframework`,
+`pkg-config` or `cmake`.
## Shaderc
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index 71ea1d1..f3879be 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -252,8 +252,9 @@ gl_factory = DependencyFactory(
sdl2_factory = DependencyFactory(
'sdl2',
- [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK],
+ [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK, DependencyMethods.CMAKE],
configtool_class=SDL2DependencyConfigTool,
+ cmake_name='SDL2',
)
vulkan_factory = DependencyFactory(
diff --git a/test cases/frameworks/16 sdl2/meson_options.txt b/test cases/frameworks/16 sdl2/meson_options.txt
index 176af17..039a3f5 100644
--- a/test cases/frameworks/16 sdl2/meson_options.txt
+++ b/test cases/frameworks/16 sdl2/meson_options.txt
@@ -1,6 +1,6 @@
option(
'method',
type : 'combo',
- choices : ['auto', 'pkg-config', 'config-tool', 'sdlconfig', 'extraframework'],
+ choices : ['auto', 'pkg-config', 'config-tool', 'sdlconfig', 'extraframework', 'cmake'],
value : 'auto',
)
diff --git a/test cases/frameworks/16 sdl2/test.json b/test cases/frameworks/16 sdl2/test.json
index 57a3f21..ee4112a 100644
--- a/test cases/frameworks/16 sdl2/test.json
+++ b/test cases/frameworks/16 sdl2/test.json
@@ -6,7 +6,8 @@
{ "val": "pkg-config" },
{ "val": "config-tool" },
{ "val": "sdlconfig" },
- { "val": "extraframework", "skip_on_os": ["!darwin"], "skip_on_jobname": ["macos"] }
+ { "val": "extraframework", "skip_on_os": ["!darwin"], "skip_on_jobname": ["macos"] },
+ { "val": "cmake", "skip_on_jobname": ["bionic"] }
]
}
},