libsdl2: Fix build when libunwind is not used

clang provides libunwind.h and cmake adds a check to
find libunwind when this header is detected, which was
not the case with automake. The check however is expecting
specific unwinder implementation which provides libunwind-generic
solib, this is not a standard library that all implementations
will provide, therefore make this check optional.

(From OE-Core rev: fb450807774d100b9b568364b014ac46f5642b7e)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj
2022-01-07 11:22:55 -08:00
committed by Richard Purdie
parent c48097ece9
commit 0b032e6ff4
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
Do not error when libunwind-generic is not found, Not all
implementations of libunwind will provide this library therefore
do not make it hard error if its not found.
Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/5194]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1358,7 +1358,7 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROI
if(HAVE_LIBUNWIND_H)
# We've already found the header, so REQUIRE the lib to be present
pkg_search_module(UNWIND REQUIRED libunwind)
- pkg_search_module(UNWIND_GENERIC REQUIRED libunwind-generic)
+ pkg_search_module(UNWIND_GENERIC libunwind-generic)
list(APPEND EXTRA_LIBS ${UNWIND_LIBRARIES} ${UNWIND_GENERIC_LIBRARIES})
endif()
endif()

View File

@@ -18,6 +18,7 @@ PROVIDES = "virtual/libsdl2"
SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
file://0001-Fix-build-against-wayland-1.20.patch \
file://optional-libunwind-generic.patch \
"
S = "${WORKDIR}/SDL2-${PV}"