Skip to content

Commit 0484f15

Browse files
committed
bombermaan: fix build for Buster/Bullseye
Added a patch for CMake to fix generating/building Bombermaaan with older SDL2/SDL2_mixer: - on Bullseye/Ubuntu 20.4, `sdl2_mixer-config.cmake` doesn't contain the target aliases in the `SDL2_mixer` namespace. - on Buster, `sdl2-config.cmake` doesn't contain the target aliases in the `SDL2` namespace and the includes/libraries are not correctly added to the compilation and linkage options.
1 parent b2354f7 commit 0484f15

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

scriptmodules/ports/bombermaaan.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function depends_bombermaaan() {
2222

2323
function sources_bombermaaan() {
2424
gitPullOrClone
25+
applyPatch "$md_data/01-cmake-sdl-mixer.diff"
2526
}
2627

2728
function build_bombermaaan() {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
diff --git a/trunk/src/CMakeLists.txt b/trunk/src/CMakeLists.txt
2+
index 5be7af8..8a260bb 100644
3+
--- a/trunk/src/CMakeLists.txt
4+
+++ b/trunk/src/CMakeLists.txt
5+
@@ -165,7 +165,13 @@ source_group("Header Files" FILES ${BOMBERMAAAN_HEADERS} ${BOMBERMAAAN_DX_HEADER
6+
source_group("Source Files" FILES ${BOMBERMAAAN_SOURCES} ${BOMBERMAAAN_DX_SOURCES} ${BOMBERMAAAN_NET_SOURCES} ${WINREPLACE_SOURCES})
7+
8+
find_package(SDL2 REQUIRED)
9+
-find_package(SDL2_mixer REQUIRED)
10+
+find_package(SDL2_mixer QUIET)
11+
+if(NOT SDL2_mixer_FOUND)
12+
+ find_library(SDL2_MIXER_LIBRARIES NAMES SDL2_mixer)
13+
+ if(NOT SDL2_MIXER_LIBRARIES)
14+
+ MESSAGE(FATAL_ERROR "SDL2_mixer libraries missing !")
15+
+ endif()
16+
+endif()
17+
18+
if(USE_ALLEGRO)
19+
find_package(Allegro4 REQUIRED)
20+
@@ -182,7 +188,7 @@ if(CRASH_REPORT)
21+
endif()
22+
23+
set(BOMBERMAAAN_INCLUDE_DIRS
24+
- ${SDL2_INCLUDE_DIR}
25+
+ ${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}
26+
${SDL2_MIXER_INCLUDE_DIR}
27+
)
28+
29+
@@ -207,8 +213,8 @@ include_directories(
30+
)
31+
32+
set(BOMBERMAAAN_LIBRARIES
33+
- SDL2::SDL2
34+
- SDL2_mixer::SDL2_mixer
35+
+ $<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,${SDL2_LIBRARIES}>
36+
+ $<IF:$<TARGET_EXISTS:SDL2_mixer::SDL2_mixer>,SDL2_mixer::SDL2_mixer,${SDL2_MIXER_LIBRARIES}>
37+
tinyxml
38+
)
39+

0 commit comments

Comments
 (0)