diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fefaa13a..8116fb43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Generate git hash and tarball run: | sudo apt update - sudo apt install -y ninja-build cmake g++ libsdl2-dev zlib1g-dev + sudo apt install -y ninja-build cmake g++ libsdl3-dev zlib1g-dev cmake --preset linux cmake --build --preset linux -t get_git_hash cmake --build --preset linux -t package_source diff --git a/BUILD.md b/BUILD.md index 8033a10e..6107989c 100644 --- a/BUILD.md +++ b/BUILD.md @@ -2,7 +2,7 @@ # Building Descent 3 Open Source ## Dependencies -The build process uses [**CMake**](https://cmake.org/) and, by default, [**Ninja**](https://ninja-build.org/). You must install these; the project cannot locate them for you. The source code depends on [**SDL2**](https://github.com/libsdl-org/SDL/tree/SDL2) and [**zlib**](https://github.com/madler/zlib). You can supply these dependencies yourself via your system's library management tools, or the build system can locate the dependencies for you using [vcpkg](https://github.com/microsoft/vcpkg), a cross-platform dependency-management system developed by Microsoft. The official builds source their dependencies from vcpkg. +The build process uses [**CMake**](https://cmake.org/) and, by default, [**Ninja**](https://ninja-build.org/). You must install these; the project cannot locate them for you. The source code depends on [**SDL3**](https://github.com/libsdl-org/SDL/tree/main) and [**zlib**](https://github.com/madler/zlib). You can supply these dependencies yourself via your system's library management tools, or the build system can locate the dependencies for you using [vcpkg](https://github.com/microsoft/vcpkg), a cross-platform dependency-management system developed by Microsoft. The official builds source their dependencies from vcpkg. ## Installing and using vcpkg * When building for Windows, vcpkg is already installed and configured when using any of the Visual Studio command prompts (either actual Command Prompt, or PowerShell). @@ -132,11 +132,11 @@ Once CMake finishes, the built files will be put in `builds/mac/build/Debug` or * If you would like to manage the code dependencies yourself: * APT users ```sh - sudo apt install -y --no-install-recommends libsdl2-dev zlib1g-dev libcpp-httplib-dev libgtest-dev libglm-dev + sudo apt install -y --no-install-recommends libsdl3-dev zlib1g-dev libcpp-httplib-dev libgtest-dev libglm-dev ``` * DNF users ```sh - sudo dnf install -y SDL2-devel zlib-devel cpp-httplib-devel gtest glm-devel + sudo dnf install -y SDL3-devel zlib-devel cpp-httplib-devel gtest glm-devel ``` 3. **Clone the Descent3 source code.** diff --git a/CMakeLists.txt b/CMakeLists.txt index b204b432..0201b34a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,9 +161,9 @@ endif() find_package(glm REQUIRED) find_package(httplib REQUIRED) -find_package(SDL2 REQUIRED) -# Some versions of the SDL2 find_package set SDL2_INCLUDE_DIR and some set a plural SDL2_INCLUDE_DIRS. Check both. -message("SDL2 Include Dir is ${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}") +find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3) +# Some versions of the SDL3 find_package set SDL3_INCLUDE_DIR and some set a plural SDL3_INCLUDE_DIRS. Check both. +message("SDL3 Include Dir is ${SDL3_INCLUDE_DIR} ${SDL3_INCLUDE_DIRS}") if(USE_EXTERNAL_PLOG) find_package(plog REQUIRED) endif() @@ -171,11 +171,11 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") message("Building for Linux") add_compile_definitions(POSIX __LINUX__ _USE_OGL_ACTIVE_TEXTURES PRIMARY_HOG=\"d3-linux.hog\") - set(PLATFORM_INCLUDES "lib/linux" ${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}) + set(PLATFORM_INCLUDES "lib/linux" ${SDL3_INCLUDE_DIR} ${SDL3_INCLUDE_DIRS}) elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") message("Building for MAC OSX") add_compile_definitions(POSIX MACOSX=1 _USE_OGL_ACTIVE_TEXTURES PRIMARY_HOG=\"d3-osx.hog\") - set(PLATFORM_INCLUDES "lib/linux" ${SDL2_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}) + set(PLATFORM_INCLUDES "lib/linux" ${SDL3_INCLUDE_DIR} ${SDL3_INCLUDE_DIRS}) elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") # Windows.h defines to avoid as many issues as possible. add_compile_definitions(WIN32_LEAN_AND_MEAN NOMINMAX NODRAWTEXT NOBITMAP NOMCX NOSERVICE PRIMARY_HOG=\"d3-win.hog\" diff --git a/Descent3/CMakeLists.txt b/Descent3/CMakeLists.txt index 91fd9ebe..9673c333 100644 --- a/Descent3/CMakeLists.txt +++ b/Descent3/CMakeLists.txt @@ -312,7 +312,7 @@ file(GLOB_RECURSE INCS "../lib/*.h") add_executable(Descent3 WIN32 MACOSX_BUNDLE ${D3Icon} ${HEADERS} ${CPPS} ${INCS} ${MANIFEST} ${RC_FILE}) target_link_libraries(Descent3 PRIVATE - SDL2::SDL2 + SDL3::SDL3 2dlib AudioEncode bitmap diff --git a/ddebug/CMakeLists.txt b/ddebug/CMakeLists.txt index 8d4aec7d..c83e84ab 100644 --- a/ddebug/CMakeLists.txt +++ b/ddebug/CMakeLists.txt @@ -30,6 +30,6 @@ target_link_libraries(ddebug PRIVATE misc > PUBLIC - SDL2::SDL2 + SDL3::SDL3 logger ) diff --git a/ddio/CMakeLists.txt b/ddio/CMakeLists.txt index b2f7d446..8a8bc7c4 100644 --- a/ddio/CMakeLists.txt +++ b/ddio/CMakeLists.txt @@ -28,7 +28,7 @@ set(CPPS ) add_library(ddio STATIC ${HEADERS} ${CPPS}) target_link_libraries(ddio PRIVATE - SDL2::SDL2 + SDL3::SDL3 ddebug logger mem diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index d85f30b3..1aabceaa 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -564,7 +564,7 @@ set(SOURCE set(CMAKE_MFC_FLAG 1) # Editor only works in Windows, because of MFC and DirectX dependencies -set(PLATFORM_LIBS linux wsock32.lib winmm.lib dd_grwin32 win32 SDL2::SDL2) +set(PLATFORM_LIBS linux wsock32.lib winmm.lib dd_grwin32 win32 SDL3::SDL3) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:LIBC") diff --git a/libmve/CMakeLists.txt b/libmve/CMakeLists.txt index 6d5b10e1..1efa019e 100644 --- a/libmve/CMakeLists.txt +++ b/libmve/CMakeLists.txt @@ -16,7 +16,7 @@ set(CPPS add_library(libmve STATIC ${HEADERS} ${CPPS}) target_link_libraries(libmve PRIVATE ddio - SDL2::SDL2 + SDL3::SDL3 ) target_include_directories(libmve PUBLIC $=": "2.30.8", "features": ["x11", "wayland", "alsa"], "default-features": false, "platform": "linux & !native" }, { - "name": "sdl2", + "name": "sdl3", "version>=": "2.30.8", "features": ["x11","wayland", "alsa"], "platform": "linux & native" }, { - "name": "sdl2", + "name": "sdl3", "version>=": "2.30.8", "platform": "!linux" } ], "overrides": [ { - "name": "sdl2", + "name": "sdl3", "version": "2.30.8" } ]