summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/libsdl2
diff options
context:
space:
mode:
authorMax Krummenacher <max.oss.09@gmail.com>2022-01-11 13:57:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-12 21:09:01 +0000
commit0ce8ea9ae095c1bc1824d81cf0fca7810bd07508 (patch)
tree9441ca3c4d6b080170470e3a6faf48ba520a6cf0 /meta/recipes-graphics/libsdl2
parent72039934f5bd1fce64f752b8bca664c84791e18c (diff)
downloadpoky-0ce8ea9ae095c1bc1824d81cf0fca7810bd07508.tar.gz
libsdl2: fix build if egl.pc sets macros in cflags
(From OE-Core rev: 59b583fa3f10fd82d11ccc5811c61a4ff8f14de6) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/libsdl2')
-rw-r--r--meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch46
-rw-r--r--meta/recipes-graphics/libsdl2/libsdl2_2.0.18.bb1
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch b/meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch
new file mode 100644
index 0000000000..e5d6cda0eb
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch
@@ -0,0 +1,46 @@
1From dbf0a3f6ea77a1d5f5e3c4dec7a22fcc09a49537 Mon Sep 17 00:00:00 2001
2From: Max Krummenacher <max.krummenacher@toradex.com>
3Date: Mon, 10 Jan 2022 21:52:02 +0000
4Subject: [PATCH] cmake: sdlchecks.cmake: pass cflags to the appropriate cmake
5 variable
6
7If egl.pc sets at least two macros as the i.MX Vivante driver does, e.g.:
8| Cflags: -I${includedir} -DLINUX -DWL_EGL_PLATFORM
9
10then we get the following error during configuration:
11
12| -- Performing Test HAVE_OPENGL_EGL
13| CMake Error: Parse error in command line argument: WL_EGL_PLATFORM
14| Should be: VAR:type=value
15
16If one changes to add a value to the macro, e.g.
17| Cflags: -I${includedir} -DLINUX=1 -DWL_EGL_PLATFORM=1
18then cmake does not error out but the macro is not passed to the
19C compiler.
20
21CMAKE_REQUIRED_FLAGS is the wrong variable to pass the CFLAGS in,
22CMAKE_REQUIRED_DEFINITIONS should be used.
23
24Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/5209]
25Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
26---
27 cmake/sdlchecks.cmake | 3 +--
28 1 file changed, 1 insertion(+), 2 deletions(-)
29
30diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
31index 32be19c..f61b8df 100644
32--- a/cmake/sdlchecks.cmake
33+++ b/cmake/sdlchecks.cmake
34@@ -808,8 +808,7 @@ endmacro()
35 macro(CheckEGL)
36 if (SDL_OPENGL OR SDL_OPENGLES)
37 pkg_check_modules(EGL egl)
38- string(REPLACE "-D_THREAD_SAFE;" "-D_THREAD_SAFE=1;" EGL_CFLAGS "${EGL_CFLAGS}")
39- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${EGL_CFLAGS}")
40+ set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${EGL_CFLAGS}")
41 check_c_source_compiles("
42 #define EGL_API_FB
43 #define MESA_EGL_NO_X11_HEADERS
44--
452.20.1
46
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.18.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.18.bb
index 1559d5e942..6c949d9604 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.18.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.18.bb
@@ -19,6 +19,7 @@ PROVIDES = "virtual/libsdl2"
19SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \ 19SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
20 file://0001-Fix-build-against-wayland-1.20.patch \ 20 file://0001-Fix-build-against-wayland-1.20.patch \
21 file://optional-libunwind-generic.patch \ 21 file://optional-libunwind-generic.patch \
22 file://0001-sdlchecks.cmake-pass-cflags-to-the-appropriate-cmake.patch \
22" 23"
23 24
24S = "${WORKDIR}/SDL2-${PV}" 25S = "${WORKDIR}/SDL2-${PV}"