blob: 01f64dd5ea6acf26b978e82df4712ef872522167 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
From 9accc179f21c54a0ca552617dff243d9fdc3e1bf Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Tue, 9 Jun 2026 16:31:56 +0100
Subject: [PATCH] cmake: link against the exported SDL3 and SDL3_mixer targets
The link line referenced ${SDL3_LIBRARIES} and ${SDL3_mixer_LIBRARIES},
variables that the SDL3 / SDL3_mixer 3.2 CMake config packages do not
define. As a result the executable failed to link with a long list of
undefined references to the SDL and MIX_* symbols.
The config packages instead export the imported targets SDL3::SDL3 and
SDL3_mixer::SDL3_mixer (which also carry the correct include directories
and transitive dependencies). Link against those.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,4 +21,4 @@ add_executable(sdl3-doom src/i_main.c sr
src/r_sky.c src/r_things.c src/sha1.c src/sounds.c src/statdump.c src/st_lib.c src/st_stuff.c src/s_sound.c src/tables.c
src/v_video.c src/wi_stuff.c src/w_checksum.c src/w_file.c src/w_main.c src/w_wad.c src/z_zone.c src/w_file_stdc.c )
-target_link_libraries(sdl3-doom PRIVATE ${SDL3_LIBRARIES} ${SDL3_mixer_LIBRARIES})
+target_link_libraries(sdl3-doom PRIVATE SDL3::SDL3 SDL3_mixer::SDL3_mixer)
|