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.
pull/11709/head
Matthieu Bouron 2 years ago committed by Eli Schwartz
parent 18cfa545f0
commit 09ec4f6e22
  1. 6
      docs/markdown/Dependencies.md
  2. 3
      mesonbuild/dependencies/ui.py
  3. 2
      test cases/frameworks/16 sdl2/meson_options.txt
  4. 3
      test cases/frameworks/16 sdl2/test.json

@ -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

@ -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(

@ -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',
)

@ -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"] }
]
}
},

Loading…
Cancel
Save