Skip to content

Commit

Permalink
Ports/SDL2: Do an out-of-tree build
Browse files Browse the repository at this point in the history
SDL 2.24.0 starts having include loops if we try to do an in-tree build
against its wishes, so let's not do that anymore.
  • Loading branch information
timschumi authored and linusg committed Aug 23, 2022
1 parent ffe9a86 commit 2e31a47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 10 additions & 2 deletions Ports/SDL2/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt" "-
depends=("libiconv")

configure() {
run cmake "${configopts[@]}"
mkdir -p "${PORT_BUILD_DIR}/SDL2-${version}-build"
cd "${PORT_BUILD_DIR}/SDL2-${version}-build"
cmake "${configopts[@]}" "${PORT_BUILD_DIR}/SDL2-${version}"
}

build() {
cd "${PORT_BUILD_DIR}/SDL2-${version}-build"
make "${makeopts[@]}"
}

install() {
run make install
cd "${PORT_BUILD_DIR}/SDL2-${version}-build"
make install
}
16 changes: 4 additions & 12 deletions Ports/SDL2/patches/0001-Add-SerenityOS-platform-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Co-Authored-By: Stephan Unverwerth <[email protected]>
Co-Authored-By: Tim Schumacher <[email protected]>
Co-Authored-By: circl <[email protected]>
---
CMakeLists.txt | 29 +-
CMakeLists.txt | 25 +-
build-scripts/config.sub | 3 +
cmake/sdlchecks.cmake | 20 +
include/SDL_config.h.cmake | 2 +
Expand All @@ -36,7 +36,7 @@ Co-Authored-By: circl <[email protected]>
src/video/serenity/SDL_serenitymouse.h | 39 +
src/video/serenity/SDL_serenityvideo.cpp | 720 ++++++++++++++++++
src/video/serenity/SDL_serenityvideo.h | 98 +++
20 files changed, 1414 insertions(+), 29 deletions(-)
20 files changed, 1414 insertions(+), 25 deletions(-)
create mode 100644 src/audio/serenity/SDL_serenityaudio.cpp
create mode 100644 src/audio/serenity/SDL_serenityaudio.h
create mode 100644 src/video/serenity/SDL_serenityevents.cpp
Expand All @@ -49,18 +49,10 @@ Co-Authored-By: circl <[email protected]>
create mode 100644 src/video/serenity/SDL_serenityvideo.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 644715a..2400d53 100644
index 644715a..4cd432d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,3 @@
-if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
- message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there")
-endif()
-
cmake_minimum_required(VERSION 3.0.0)
project(SDL2 C CXX)

@@ -17,6 +13,9 @@ endif()
@@ -17,6 +17,9 @@ endif()
# etc. See https://github.com/libsdl-org/SDL/issues/4150
add_library(sdl-build-options INTERFACE)

Expand Down

0 comments on commit 2e31a47

Please sign in to comment.