Skip to content

Commit

Permalink
Merge pull request #2200 from ericoporto/upgrade-sdl2-sound-fix-cmake…
Browse files Browse the repository at this point in the history
…-warning

Upgrade SDL2 Sound fix a few CMake warnings
  • Loading branch information
ivan-mogilko authored Oct 27, 2023
2 parents 3517286 + 1d6acae commit 369b112
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CMake/FetchGoogleTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ if(LINUX AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS
set(LINUX_OLD_GCC TRUE)
FetchContent_Declare(
googletest_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/google/googletest/archive/refs/tags/release-1.8.1.tar.gz
URL_HASH MD5=2e6fbeb6a91310a16efe181886c59596
)
else()
set(LINUX_OLD_GCC FALSE)
FetchContent_Declare(
googletest_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/google/googletest/archive/4ec4cd23f486bf70efcc5d2caa40f24368f752e3.tar.gz
URL_HASH MD5=b907483a9045a2edda15ee7d2a68aaa5
)
Expand Down
1 change: 1 addition & 0 deletions CMake/FetchOgg.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
ogg_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.tar.xz
URL_HASH MD5=3178c98341559657a15b185bf5d700a5
)
Expand Down
1 change: 1 addition & 0 deletions CMake/FetchSDL2.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
sdl2_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.28.2.tar.gz
URL_HASH MD5=e00fe25102433d40d39ba67007a9fd2c
)
Expand Down
6 changes: 3 additions & 3 deletions CMake/FetchSDL_Sound.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FetchContent_Declare(
sdlsound_content
URL https://github.com/icculus/SDL_sound/archive/495e948b455af48eb45f75cccc060498f1e0e8a2.tar.gz
URL_HASH MD5=d743aee2e550dca3a96b14d41e78b530
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/icculus/SDL_sound/archive/1507be95c3605e4fd6a48ea4c527e4aa711a1566.tar.gz
URL_HASH MD5=f945a7330089d1c3490404b4f18fdffd
)

FetchContent_GetProperties(sdlsound_content)
Expand All @@ -22,5 +23,4 @@ if(NOT sdlsound_content)
add_library(sdl2_sound-interface INTERFACE)
target_link_libraries(sdl2_sound-interface INTERFACE SDL2_sound-static)
add_library(SDL2_sound::SDL2_sound ALIAS sdl2_sound-interface)
target_link_libraries(SDL2_sound-static ${SDL2_LIBRARIES})
endif()
1 change: 1 addition & 0 deletions CMake/FetchTheora.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
theora_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/xiph/theora/archive/7180717276af1ebc7da15c83162d6c5d6203aabf.tar.gz
URL_HASH MD5=5f1c0b5efdec0f9621bc59ba89e6652b
)
Expand Down
1 change: 1 addition & 0 deletions CMake/FetchVorbis.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FetchContent_Declare(
vorbis_content
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
URL https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.xz
URL_HASH MD5=50902641d358135f06a8392e61c9ac77
)
Expand Down
2 changes: 1 addition & 1 deletion OSX/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The Xcode project depends on the prebuilt SDL2 Framework and library sources.

The project also requires sources of library dependencies, either using the `libsrc/download.sh` script or manually downloading them and extracting them as below.

- Download [SDL_sound](https://github.com/icculus/SDL_sound/archive/8d96d4cc0e1df35835a222ee51a7c32f273ec63e.zip) source code and place it in `ags/libsrc/SDL_sound`
- Download [SDL_sound](https://github.com/icculus/SDL_sound/archive/1507be95c3605e4fd6a48ea4c527e4aa711a1566.zip) source code and place it in `ags/libsrc/SDL_sound`
- Download xiph [theora](https://github.com/xiph/theora/archive/7180717276af1ebc7da15c83162d6c5d6203aabf.tar.gz) source code, and place it in `ags/libsrc/theora`
- Download xiph [ogg](https://github.com/xiph/ogg/archive/refs/tags/v1.3.5.tar.gz) source code, and place in `ags/libsrc/ogg`
- Download xiph [vorbis](https://github.com/xiph/vorbis/archive/84c023699cdf023a32fa4ded32019f194afcdad0.tar.gz) source code, and place in `ags/libsrc/vorbis`
Expand Down
2 changes: 1 addition & 1 deletion Windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ and SDL2.dll to run.
Official page for SDL_Sound library is https://www.icculus.org/SDL_sound/, but downloads are hosted on github: https://github.com/icculus/SDL_sound/releases.
Any latest 2.0.X release should be good.

For the reference, at the time of writing our build server is using revision 495e948b45: https://github.com/icculus/SDL_sound/archive/495e948b455af48eb45f75cccc060498f1e0e8a2.tar.gz
For the reference, at the time of writing our build server is using revision 1507be95c3: https://github.com/icculus/SDL_sound/archive/1507be95c3605e4fd6a48ea4c527e4aa711a1566.tar.gz

After you downloaded the source this way or another, you should use CMake to generate MSVS solution from their provided CMakeList.txt.
Note that when doing this you may have to direct CMake to the SDL2's cmake config files. First go to the SDL2's sources location and find "cmake" directory inside. It should contain the file called "sdl2-config.cmake". If the file is not present, this means something is wrong with the SDL2's package, or maybe you've downloaded a way too old version of SDL2.
Expand Down
2 changes: 1 addition & 1 deletion ci/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ RUN curl -fLsS "https://github.com/xiph/theora/archive/refs/tags/v${LIBTHEORA_VE
rm /tmp/libtheora-${LIBTHEORA_VERSION}.tar.gz

# Build and install SDL_sound
ARG SDL2_SOUND_VERSION=495e948b455af48eb45f75cccc060498f1e0e8a2
ARG SDL2_SOUND_VERSION=1507be95c3605e4fd6a48ea4c527e4aa711a1566
RUN cd /tmp && \
curl -fLsS "https://github.com/icculus/SDL_sound/archive/$SDL2_SOUND_VERSION.tar.gz" --output SDL_sound.tar.gz && \
tar -xvzf SDL_sound.tar.gz && \
Expand Down
2 changes: 1 addition & 1 deletion ci/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ RUN mkdir Lib\SDL2 && \
echo endif ^(^) >> "Lib\SDL2\sdl2-config.cmake" && \
echo string^(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES^) >> "Lib\SDL2\sdl2-config.cmake"

ARG SDL_SOUND_VERSION=495e948b455af48eb45f75cccc060498f1e0e8a2
ARG SDL_SOUND_VERSION=1507be95c3605e4fd6a48ea4c527e4aa711a1566
RUN mkdir Lib\SDL_sound && \
echo "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 ^&^& pushd Lib\SDL_sound\build_x86 ^&^& msbuild SDL_sound.sln /p:PlatformToolset=v140 /p:Configuration=Release /p:Platform=Win32 /maxcpucount /nologo ^&^& popd > sdlsoundvcbuild_x86.bat && \
echo "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 ^&^& pushd Lib\SDL_sound\build_x64 ^&^& msbuild SDL_sound.sln /p:PlatformToolset=v140 /p:Configuration=Release /p:Platform=x64 /maxcpucount /nologo ^&^& popd > sdlsoundvcbuild_x64.bat && \
Expand Down
4 changes: 2 additions & 2 deletions debian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ parentheses are known to work, but other versions will also
probably work.

- libsdl2 (2.0.12 or higher)
- libsdl_sound for sdl2 (revision 495e948b455a or higher)
- libsdl_sound for sdl2 (revision 1507be95c3 or higher)
- libogg (1.2.2-1.3.0)
- libtheora (1.1.1-1.2.0)
- libvorbis (1.3.2)
Expand All @@ -38,7 +38,7 @@ Other Linux systems use their respective package managers.
At the time of writing SDL_Sound `2.*` has just been released, but almost no linux distro provides it.
Until that is resolved, we recommend to download particular revision archive using following url:

https://github.com/icculus/SDL_sound/archive/495e948b455af48eb45f75cccc060498f1e0e8a2.tar.gz
https://github.com/icculus/SDL_sound/archive/1507be95c3605e4fd6a48ea4c527e4aa711a1566.tar.gz

then build and install using CMake (see instructions in the SDL_Sound's docs).

Expand Down
2 changes: 1 addition & 1 deletion libsrc/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ get https://github.com/xiph/vorbis/archive/${LIBVORBIS_VERSION}.tar.gz vorbis.ta
LIBTHEORA_VERSION=7180717276af1ebc7da15c83162d6c5d6203aabf
get https://github.com/xiph/theora/archive/${LIBTHEORA_VERSION}.tar.gz theora.tar.gz

SDLSOUND_VERSION=8d96d4cc0e1df35835a222ee51a7c32f273ec63e
SDLSOUND_VERSION=1507be95c3605e4fd6a48ea4c527e4aa711a1566
get https://github.com/icculus/SDL_sound/archive/${SDLSOUND_VERSION}.tar.gz SDL_sound.tar.gz

SDL_VERSION=2.28.2
Expand Down
2 changes: 1 addition & 1 deletion libsrc/sha1sums
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
16c7c4844d8b5e8027dfb134d2971746bb1382c3 SDL.tar.gz
cf65d8e1adfe56e0b6c904698d3b8e481b413237 SDL_sound.tar.gz
1507be95c3605e4fd6a48ea4c527e4aa711a1566 SDL_sound.tar.gz
8085a94164c1eb6cfab245c5b4306c2d3ec847cd ogg.tar.gz
beaeae25bc7ace77007f42c33e0b0fa74acf4992 theora.tar.gz
76f06629562d52a9539818f3b78722fbc9e19ddb vorbis.tar.gz
Expand Down

0 comments on commit 369b112

Please sign in to comment.