diff mbox series

[meta-ti,master/wrynose] libsdl2: Build tests with dynamically linked library support

Message ID 20260630174314.1561862-1-a-christidis@ti.com
State Superseded
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master/wrynose] libsdl2: Build tests with dynamically linked library support | expand

Commit Message

Antonios Christidis June 30, 2026, 5:43 p.m. UTC
From: Antonios Christidis <a-christidis@ti.com>

Carry upstream-submitted patch that adds SDL_TESTS_SHARED_LIB option,
enabling test executables to be built with dynamic linking against
libsdl2.

Signed-off-by: Antonios Christidis <a-christidis@ti.com>
---
 .../recipes-graphics/libsdl2/libsdl2-ti.inc   |  9 +++
 ...TS_SHARED_LIB-option-for-dynamically.patch | 56 +++++++++++++++++++
 2 files changed, 65 insertions(+)
 create mode 100644 meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch

--
2.34.1

Comments

PRC Automation June 30, 2026, 6:03 p.m. UTC | #1
meta-ti / na / 20260630174314.1561862-1-a-christidis

PRC Results: PASS

=========================================================
  check-yocto-patches: PASS
=========================================================
Patches
----------------------------------------
All patches passed



=========================================================
  apply-yocto-patch: PASS
=========================================================
master
=====================
Summary:
- Patch Series: [meta-ti][master/wrynose][PATCH] libsdl2: Build tests with dynamically linked library support
- Submitter: From: <a-christidis@ti.com>
From: Antonios Christidis <a-christidis@ti.com>
+From: Antonios Christidis <a-christidis@ti.com>
- Date: Date: Tue, 30 Jun 2026 12:43:14 -0500
+Date: Fri, 26 Jun 2026 13:28:24 -0500
- Num Patches: 1
- Mailing List (public inbox) Commit SHA: 6848afcd439b0dd37df0d2d25b040310109161f0

Applied to:
- Repository: lcpd-prc-meta-ti
- Base Branch: master-wip
- Commit Author: Ryan Eatmon <reatmon@ti.com>
- Commit Subject: TEST: linux-ti-staging: Add testing dtbo and build command
- Commit SHA: 07bd4c181e2a400d4375ddad7a20fbba6578b133

Patches
----------------------------------------
All patches applied

wrynose
=====================
Summary:
- Patch Series: [meta-ti][master/wrynose][PATCH] libsdl2: Build tests with dynamically linked library support
- Submitter: From: <a-christidis@ti.com>
From: Antonios Christidis <a-christidis@ti.com>
+From: Antonios Christidis <a-christidis@ti.com>
- Date: Date: Tue, 30 Jun 2026 12:43:14 -0500
+Date: Fri, 26 Jun 2026 13:28:24 -0500
- Num Patches: 1
- Mailing List (public inbox) Commit SHA: 6848afcd439b0dd37df0d2d25b040310109161f0

Applied to:
- Repository: lcpd-prc-meta-ti
- Base Branch: wrynose-wip
- Commit Author: LCPD Automation Script <lcpdbld@list.ti.com>
- Commit Subject: CI/CD Auto-Merger: cicd.wrynose.202606241800
- Commit SHA: 937a0b45728e16c279a7dad65585da061526936a

Patches
----------------------------------------
All patches applied



=========================================================
  check-yocto-repo: PASS
=========================================================
master
=====================
PASS

wrynose
=====================
PASS



=========================================================
  yocto-check-layers: PASS
=========================================================
master - PASS
=====================
All checks passed

wrynose - PASS
=====================
All checks passed
Denys Dmytriyenko June 30, 2026, 10:51 p.m. UTC | #2
On Tue, Jun 30, 2026 at 12:43:14PM -0500, Antonios Christidis via lists.yoctoproject.org wrote:
> From: Antonios Christidis <a-christidis@ti.com>
> 
> Carry upstream-submitted patch that adds SDL_TESTS_SHARED_LIB option,
> enabling test executables to be built with dynamic linking against
> libsdl2.
> 
> Signed-off-by: Antonios Christidis <a-christidis@ti.com>
> ---
>  .../recipes-graphics/libsdl2/libsdl2-ti.inc   |  9 +++
>  ...TS_SHARED_LIB-option-for-dynamically.patch | 56 +++++++++++++++++++
>  2 files changed, 65 insertions(+)
>  create mode 100644 meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
> 
> diff --git a/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc b/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
> index 33ff0632..959818a1 100644
> --- a/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
> +++ b/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
> @@ -1,5 +1,14 @@
> +FILESEXTRAPATHS:prepend := "${THISDIR}/libsdl2:"
> +
> +SRC_URI:append = " \
> +    file://0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch \
> +"
> +
>  EXTRA_OECMAKE += "-DSDL_TESTS=ON \
>                    -DSDL_INSTALL_TESTS=ON \
> +                  -DSDL_TESTS_SHARED_LIB=ON \
>                   "
> +
>  PACKAGE_BEFORE_PN = "${PN}-tests"
>  FILES:${PN}-tests += "${libexecdir} ${datadir}/installed-tests/SDL2"
> +RDEPENDS:${PN}-tests += "${PN}"

Now that you are no longer linking statically, you should try w/o explicit 
RDEPENDS here, as bitbake is supposed to detect this dependency automatically. 
That's what Andrew was asking last week...


> diff --git a/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch b/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
> new file mode 100644
> index 00000000..cc435b3a
> --- /dev/null
> +++ b/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
> @@ -0,0 +1,56 @@
> +From 96512412805f34ac6328290221c7ad83cde342b3 Mon Sep 17 00:00:00 2001
> +From: Antonios Christidis <a-christidis@ti.com>
> +Date: Fri, 26 Jun 2026 13:28:24 -0500
> +Subject: [PATCH] test: New SDL_TESTS_SHARED_LIB option for dynamically linked
> + tests
> +
> +Introduce SDL_TESTS_SHARED_LIB to allow tests that expect dynamic linking
> +to be built.
> +
> +Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/15907]
> +
> +Signed-off-by: Antonios Christidis <a-christidis@ti.com>
> +---
> + test/CMakeLists.txt | 19 ++++++++++++++++---
> + 1 file changed, 16 insertions(+), 3 deletions(-)
> +
> +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
> +index 288645d73..8e5bd68d3 100644
> +--- a/test/CMakeLists.txt
> ++++ b/test/CMakeLists.txt
> +@@ -87,8 +87,17 @@ macro(add_sdl_test_executable TARGET)
> +     endif()
> + endmacro()
> +
> +-if(NOT TARGET SDL2::SDL2-static)
> +-    find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test)
> ++option(SDL_TESTS_SHARED_LIB "Link test executables against the shared SDL2 library" OFF)
> ++
> ++if(SDL_TESTS_SHARED_LIB)
> ++    set(SDL_SHARED ON)
> ++    if(NOT TARGET SDL2::SDL2)
> ++        find_package(SDL2 ${SDL_VERSION} REQUIRED COMPONENTS SDL2 SDL2test)
> ++    endif()
> ++else()
> ++    if(NOT TARGET SDL2::SDL2-static)
> ++        find_package(SDL2 ${SDL_VERSION} REQUIRED COMPONENTS SDL2-static SDL2test)
> ++    endif()
> + endif()
> +
> + enable_testing()
> +@@ -247,7 +256,11 @@ elseif(PS2)
> + elseif(IOS OR TVOS)
> +     sdltest_link_librararies(SDL2::SDL2main SDL2::SDL2test SDL2::SDL2-static)
> + else()
> +-    sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2-static)
> ++    if(SDL_TESTS_SHARED_LIB)
> ++        sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2)
> ++    else()
> ++        sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2-static)
> ++    endif()
> + endif()
> +
> + if(WINDOWS)
> +--
> +2.34.1
> +
> --
> 2.34.1
Antonios Christidis July 1, 2026, 6:28 p.m. UTC | #3
On 6/30/26 5:51 PM, Denys Dmytriyenko wrote:
> On Tue, Jun 30, 2026 at 12:43:14PM -0500, Antonios Christidis via lists.yoctoproject.org wrote:
>> From: Antonios Christidis <a-christidis@ti.com>
>>
>> Carry upstream-submitted patch that adds SDL_TESTS_SHARED_LIB option,
>> enabling test executables to be built with dynamic linking against
>> libsdl2.
>>
>> Signed-off-by: Antonios Christidis <a-christidis@ti.com>
>> ---
>>   .../recipes-graphics/libsdl2/libsdl2-ti.inc   |  9 +++
>>   ...TS_SHARED_LIB-option-for-dynamically.patch | 56 +++++++++++++++++++
>>   2 files changed, 65 insertions(+)
>>   create mode 100644 meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
>>
>> diff --git a/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc b/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
>> index 33ff0632..959818a1 100644
>> --- a/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
>> +++ b/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
>> @@ -1,5 +1,14 @@
>> +FILESEXTRAPATHS:prepend := "${THISDIR}/libsdl2:"
>> +
>> +SRC_URI:append = " \
>> +    file://0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch \
>> +"
>> +
>>   EXTRA_OECMAKE += "-DSDL_TESTS=ON \
>>                     -DSDL_INSTALL_TESTS=ON \
>> +                  -DSDL_TESTS_SHARED_LIB=ON \
>>                    "
>> +
>>   PACKAGE_BEFORE_PN = "${PN}-tests"
>>   FILES:${PN}-tests += "${libexecdir} ${datadir}/installed-tests/SDL2"
>> +RDEPENDS:${PN}-tests += "${PN}"
> Now that you are no longer linking statically, you should try w/o explicit
> RDEPENDS here, as bitbake is supposed to detect this dependency automatically.
> That's what Andrew was asking last week...
>
Understood. I was mistaken, originally "bitbake -e" option did not show 
the package dependency.

But looking at the image manifest in the deploy dir now I can see the 
main libsdl2 package is present alongside the test package.

Sending revision.

>> diff --git a/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch b/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
>> new file mode 100644
>> index 00000000..cc435b3a
>> --- /dev/null
>> +++ b/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
>> @@ -0,0 +1,56 @@
>> +From 96512412805f34ac6328290221c7ad83cde342b3 Mon Sep 17 00:00:00 2001
>> +From: Antonios Christidis <a-christidis@ti.com>
>> +Date: Fri, 26 Jun 2026 13:28:24 -0500
>> +Subject: [PATCH] test: New SDL_TESTS_SHARED_LIB option for dynamically linked
>> + tests
>> +
>> +Introduce SDL_TESTS_SHARED_LIB to allow tests that expect dynamic linking
>> +to be built.
>> +
>> +Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/15907]
>> +
>> +Signed-off-by: Antonios Christidis <a-christidis@ti.com>
>> +---
>> + test/CMakeLists.txt | 19 ++++++++++++++++---
>> + 1 file changed, 16 insertions(+), 3 deletions(-)
>> +
>> +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
>> +index 288645d73..8e5bd68d3 100644
>> +--- a/test/CMakeLists.txt
>> ++++ b/test/CMakeLists.txt
>> +@@ -87,8 +87,17 @@ macro(add_sdl_test_executable TARGET)
>> +     endif()
>> + endmacro()
>> +
>> +-if(NOT TARGET SDL2::SDL2-static)
>> +-    find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test)
>> ++option(SDL_TESTS_SHARED_LIB "Link test executables against the shared SDL2 library" OFF)
>> ++
>> ++if(SDL_TESTS_SHARED_LIB)
>> ++    set(SDL_SHARED ON)
>> ++    if(NOT TARGET SDL2::SDL2)
>> ++        find_package(SDL2 ${SDL_VERSION} REQUIRED COMPONENTS SDL2 SDL2test)
>> ++    endif()
>> ++else()
>> ++    if(NOT TARGET SDL2::SDL2-static)
>> ++        find_package(SDL2 ${SDL_VERSION} REQUIRED COMPONENTS SDL2-static SDL2test)
>> ++    endif()
>> + endif()
>> +
>> + enable_testing()
>> +@@ -247,7 +256,11 @@ elseif(PS2)
>> + elseif(IOS OR TVOS)
>> +     sdltest_link_librararies(SDL2::SDL2main SDL2::SDL2test SDL2::SDL2-static)
>> + else()
>> +-    sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2-static)
>> ++    if(SDL_TESTS_SHARED_LIB)
>> ++        sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2)
>> ++    else()
>> ++        sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2-static)
>> ++    endif()
>> + endif()
>> +
>> + if(WINDOWS)
>> +--
>> +2.34.1
>> +
>> --
>> 2.34.1
diff mbox series

Patch

diff --git a/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc b/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
index 33ff0632..959818a1 100644
--- a/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
+++ b/meta-ti-test/recipes-graphics/libsdl2/libsdl2-ti.inc
@@ -1,5 +1,14 @@ 
+FILESEXTRAPATHS:prepend := "${THISDIR}/libsdl2:"
+
+SRC_URI:append = " \
+    file://0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch \
+"
+
 EXTRA_OECMAKE += "-DSDL_TESTS=ON \
                   -DSDL_INSTALL_TESTS=ON \
+                  -DSDL_TESTS_SHARED_LIB=ON \
                  "
+
 PACKAGE_BEFORE_PN = "${PN}-tests"
 FILES:${PN}-tests += "${libexecdir} ${datadir}/installed-tests/SDL2"
+RDEPENDS:${PN}-tests += "${PN}"
diff --git a/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch b/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
new file mode 100644
index 00000000..cc435b3a
--- /dev/null
+++ b/meta-ti-test/recipes-graphics/libsdl2/libsdl2/0001-test-New-SDL_TESTS_SHARED_LIB-option-for-dynamically.patch
@@ -0,0 +1,56 @@ 
+From 96512412805f34ac6328290221c7ad83cde342b3 Mon Sep 17 00:00:00 2001
+From: Antonios Christidis <a-christidis@ti.com>
+Date: Fri, 26 Jun 2026 13:28:24 -0500
+Subject: [PATCH] test: New SDL_TESTS_SHARED_LIB option for dynamically linked
+ tests
+
+Introduce SDL_TESTS_SHARED_LIB to allow tests that expect dynamic linking
+to be built.
+
+Upstream-Status: Submitted [https://github.com/libsdl-org/SDL/pull/15907]
+
+Signed-off-by: Antonios Christidis <a-christidis@ti.com>
+---
+ test/CMakeLists.txt | 19 ++++++++++++++++---
+ 1 file changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 288645d73..8e5bd68d3 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -87,8 +87,17 @@ macro(add_sdl_test_executable TARGET)
+     endif()
+ endmacro()
+
+-if(NOT TARGET SDL2::SDL2-static)
+-    find_package(SDL2 2.0.23 REQUIRED COMPONENTS SDL2-static SDL2test)
++option(SDL_TESTS_SHARED_LIB "Link test executables against the shared SDL2 library" OFF)
++
++if(SDL_TESTS_SHARED_LIB)
++    set(SDL_SHARED ON)
++    if(NOT TARGET SDL2::SDL2)
++        find_package(SDL2 ${SDL_VERSION} REQUIRED COMPONENTS SDL2 SDL2test)
++    endif()
++else()
++    if(NOT TARGET SDL2::SDL2-static)
++        find_package(SDL2 ${SDL_VERSION} REQUIRED COMPONENTS SDL2-static SDL2test)
++    endif()
+ endif()
+
+ enable_testing()
+@@ -247,7 +256,11 @@ elseif(PS2)
+ elseif(IOS OR TVOS)
+     sdltest_link_librararies(SDL2::SDL2main SDL2::SDL2test SDL2::SDL2-static)
+ else()
+-    sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2-static)
++    if(SDL_TESTS_SHARED_LIB)
++        sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2)
++    else()
++        sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2-static)
++    endif()
+ endif()
+
+ if(WINDOWS)
+--
+2.34.1
+