Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
a449fa4a
Commit
a449fa4a
authored
4 years ago
by
Marco Z
Browse files
Options
Downloads
Patches
Plain Diff
Added SDL Mixer X to CMAKE (Windows only)
parent
d2fefb6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!992
CMAKE additions: SDL Mixer X, *.debug adjustments, CPACK adjustments, CCACHE
,
!991
CMAKE additions: SDL Mixer X, *.debug adjustments, CPACK adjustments, CCACHE
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/CMakeLists.txt
+30
-0
30 additions, 0 deletions
src/CMakeLists.txt
src/sdl/CMakeLists.txt
+21
-2
21 additions, 2 deletions
src/sdl/CMakeLists.txt
with
51 additions
and
2 deletions
src/CMakeLists.txt
+
30
−
0
View file @
a449fa4a
...
...
@@ -226,6 +226,12 @@ set(SRB2_CONFIG_HAVE_GME ON CACHE BOOL
"Enable GME support."
)
set
(
SRB2_CONFIG_HAVE_OPENMPT ON CACHE BOOL
"Enable OpenMPT support."
)
if
(
${
CMAKE_SYSTEM
}
MATCHES Windows
)
set
(
SRB2_CONFIG_HAVE_MIXERX ON CACHE BOOL
"Enable SDL Mixer X support."
)
else
()
set
(
SRB2_CONFIG_HAVE_MIXERX OFF
)
endif
()
set
(
SRB2_CONFIG_HWRENDER ON CACHE BOOL
"Enable hardware rendering through OpenGL."
)
set
(
SRB2_CONFIG_USEASM OFF CACHE BOOL
...
...
@@ -366,6 +372,30 @@ if(${SRB2_CONFIG_HAVE_OPENMPT})
endif
()
endif
()
if
(
${
SRB2_CONFIG_HAVE_MIXERX
}
)
if
(
${
SRB2_CONFIG_USE_INTERNAL_LIBRARIES
}
)
set
(
MIXERX_FOUND ON
)
set
(
MIXERX_INCLUDE_DIRS
${
CMAKE_SOURCE_DIR
}
/libs/SDLMixerX/i686-w64-mingw32/include/SDL2
)
if
(
${
SRB2_SYSTEM_BITS
}
EQUAL 64
)
set
(
MIXERX_LIBRARIES
"-L
${
CMAKE_SOURCE_DIR
}
/libs/SDLMixerX/x86_64-w64-mingw32/lib -lSDL2_mixer_ext"
)
else
()
# 32-bit
set
(
MIXERX_LIBRARIES
"-L
${
CMAKE_SOURCE_DIR
}
/libs/SDLMixerX/i686-w64-mingw32/lib -lSDL2_mixer_ext"
)
endif
()
else
()
# No support for non-Windows (yet?)
#find_package(MIXERX)
message
(
WARNING
"SDL Mixer X is not supported as an external library."
)
set
(
MIXERX_FOUND OFF
)
endif
()
if
(
${
MIXERX_FOUND
}
)
set
(
SRB2_HAVE_MIXERX ON
)
set
(
SRB2_SDL2_SOUNDIMPL mixer_sound.c
)
add_definitions
(
-DHAVE_MIXERX
)
else
()
message
(
WARNING
"You have specified that SDL Mixer X is available but it was not found."
)
endif
()
endif
()
if
(
${
SRB2_CONFIG_HAVE_ZLIB
}
)
if
(
${
SRB2_CONFIG_USE_INTERNAL_LIBRARIES
}
)
set
(
ZLIB_FOUND ON
)
...
...
This diff is collapsed.
Click to expand it.
src/sdl/CMakeLists.txt
+
21
−
2
View file @
a449fa4a
# Declare SDL2 interface sources
set
(
SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL
"Use SDL2_mixer or regular sdl sound"
)
if
(
NOT
${
SRB2_CONFIG_HAVE_MIXERX
}
)
set
(
SRB2_CONFIG_SDL2_USEMIXER ON CACHE BOOL
"Use SDL2_mixer or regular sdl sound"
)
else
()
set
(
SRB2_CONFIG_SDL2_USEMIXER OFF
)
endif
()
if
(
${
SRB2_CONFIG_SDL2_USEMIXER
}
)
if
(
${
SRB2_CONFIG_USE_INTERNAL_LIBRARIES
}
)
...
...
@@ -22,6 +26,8 @@ if(${SRB2_CONFIG_SDL2_USEMIXER})
message
(
WARNING
"You specified that SDL2_mixer is available, but it was not found. Falling back to sdl sound."
)
set
(
SRB2_SDL2_SOUNDIMPL sdl_sound.c
)
endif
()
elseif
(
${
MIXERX_FOUND
}
)
set
(
SRB2_SDL2_SOUNDIMPL mixer_sound.c
)
else
()
set
(
SRB2_SDL2_SOUNDIMPL sdl_sound.c
)
endif
()
...
...
@@ -156,6 +162,7 @@ if(${SDL2_FOUND})
SDL2_mixer
${
GME_LIBRARIES
}
${
OPENMPT_LIBRARIES
}
${
MIXERX_LIBRARIES
}
${
PNG_LIBRARIES
}
${
ZLIB_LIBRARIES
}
${
OPENGL_LIBRARIES
}
...
...
@@ -167,6 +174,7 @@ if(${SDL2_FOUND})
${
SDL2_MIXER_LIBRARIES
}
${
GME_LIBRARIES
}
${
OPENMPT_LIBRARIES
}
${
MIXERX_LIBRARIES
}
${
PNG_LIBRARIES
}
${
ZLIB_LIBRARIES
}
${
OPENGL_LIBRARIES
}
...
...
@@ -247,12 +255,13 @@ if(${SDL2_FOUND})
${
SDL2_MIXER_INCLUDE_DIRS
}
${
GME_INCLUDE_DIRS
}
${
OPENMPT_INCLUDE_DIRS
}
${
MIXERX_INCLUDE_DIRS
}
${
PNG_INCLUDE_DIRS
}
${
ZLIB_INCLUDE_DIRS
}
${
OPENGL_INCLUDE_DIRS
}
)
if
(
${
SRB2_HAVE_MIXER
}
)
if
(
(
${
SRB2_HAVE_MIXER
}
)
OR
(
${
SRB2_HAVE_MIXERX
}
))
target_compile_definitions
(
SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER
)
endif
()
...
...
@@ -294,6 +303,7 @@ if(${SDL2_FOUND})
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2/x86_64-w64-mingw32/bin
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2_mixer/x86_64-w64-mingw32/bin
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/libopenmpt/bin/x86_64/mingw
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDLMixerX/x86_64-w64-mingw32/bin
)
else
()
find_library
(
SRB2_SDL2_DLL_
${
dllname
}
"
${
defaultname
}
"
...
...
@@ -301,6 +311,7 @@ if(${SDL2_FOUND})
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2/i686-w64-mingw32/bin
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2_mixer/i686-w64-mingw32/bin
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/libopenmpt/bin/x86/mingw
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDLMixerX/i686-w64-mingw32/bin
)
endif
()
else
()
...
...
@@ -310,6 +321,7 @@ if(${SDL2_FOUND})
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2/lib/x64
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2_mixer/lib/x64
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/libopenmpt/bin/x86_64/mingw
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDLMixerX/x86_64-w64-mingw32/bin
)
else
()
find_library
(
SRB2_SDL2_DLL_
${
dllname
}
"
${
defaultname
}
"
...
...
@@ -317,6 +329,7 @@ if(${SDL2_FOUND})
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2/lib/x86
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDL2_mixer/lib/x86
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/libopenmpt/bin/x86/mingw
HINTS
${
CMAKE_SOURCE_DIR
}
/libs/SDLMixerX/i686-w64-mingw32/bin
)
endif
()
endif
()
...
...
@@ -340,6 +353,12 @@ if(${SDL2_FOUND})
if
(
${
SRB2_CONFIG_HAVE_OPENMPT
}
)
getwinlib
(
libopenmpt
"libopenmpt.dll"
)
endif
()
if
(
${
SRB2_CONFIG_HAVE_MIXERX
}
)
getwinlib
(
SDL2_mixer_ext
"SDL2_mixer_ext.dll"
)
getwinlib
(
libfluidsynth-2
"libfluidsynth-2.dll"
)
getwinlib
(
libgcc_s_sjlj-1
"libgcc_s_sjlj-1.dll"
)
getwinlib
(
libstdc++-6
"libstdc++-6.dll"
)
endif
()
install
(
PROGRAMS
${
win_extra_dll_list
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment