1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 11:17:36 +00:00
serenity/Ports/SuperTuxKart/patches/0001-Add-build-system-support-for-Serenity.patch
Linus Groh 5c75117262 Ports/SuperTuxKart: Clean up IrrCompileConfig.h patch a little
There was still some code commented out from earlier attempts
piggybacking on Haiku ifdefs, this should now be in an upstreamable
state.
2023-07-04 19:38:24 +01:00

71 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dominika Liberda <ja@sdomi.pl>
Date: Sun, 11 Jun 2023 01:56:50 +0200
Subject: [PATCH] Add build system support for Serenity
---
lib/angelscript/source/as_memory.cpp | 2 +-
lib/irrlicht/include/IrrCompileConfig.h | 9 +++++++--
lib/shaderc/third_party/spirv-tools/CMakeLists.txt | 2 ++
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/angelscript/source/as_memory.cpp b/lib/angelscript/source/as_memory.cpp
index 5914658ba23736da57506fc58066032b5f99e435..399a3842300ed01adaf0afdbf2ae794fd89c0415 100644
--- a/lib/angelscript/source/as_memory.cpp
+++ b/lib/angelscript/source/as_memory.cpp
@@ -38,7 +38,7 @@
#include <stdlib.h>
-#if !defined(__APPLE__) && !defined(__SNC__) && !defined(__ghs__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
+#if !defined(__APPLE__) && !defined(__SNC__) && !defined(__ghs__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__serenity__)
#include <malloc.h>
#endif
diff --git a/lib/irrlicht/include/IrrCompileConfig.h b/lib/irrlicht/include/IrrCompileConfig.h
index 384c6836e2050ad8cfeaa4da3bf3365b5a3cf1a8..3ddcf1951ef9a174ccdf5ac04304d5481b85ac59 100644
--- a/lib/irrlicht/include/IrrCompileConfig.h
+++ b/lib/irrlicht/include/IrrCompileConfig.h
@@ -23,6 +23,7 @@
//! _IRR_WINDOWS_API_ for Windows or XBox
//! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined)
//! _IRR_HAIKU_PLATFORM_ for Haiku
+//! _IRR_SERENITY_PLATFORM_ for SerenityOS
//! _IRR_SOLARIS_PLATFORM_ for Solaris
//! _IRR_OSX_PLATFORM_ for Apple systems running OSX
//! _IRR_IOS_PLATFORM_ for Apple devices running iOS
@@ -98,7 +99,11 @@
#define _IRR_HAIKU_PLATFORM_
#endif
-#if defined(_IRR_HAIKU_PLATFORM_)
+#if defined(__serenity__)
+#define _IRR_SERENITY_PLATFORM_
+#endif
+
+#if defined(_IRR_HAIKU_PLATFORM_) || defined(_IRR_SERENITY_PLATFORM_)
#define _IRR_COMPILE_WITH_SDL_DEVICE_
#define _IRR_COMPILE_WITH_OPENGL_
#endif
@@ -114,7 +119,7 @@
#endif
#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_ANDROID_PLATFORM_) && !defined(_IRR_HAIKU_PLATFORM_)
-#ifndef _IRR_SOLARIS_PLATFORM_
+#if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(_IRR_SERENITY_PLATFORM_)
#define _IRR_LINUX_PLATFORM_
#endif
#define _IRR_POSIX_API_
diff --git a/lib/shaderc/third_party/spirv-tools/CMakeLists.txt b/lib/shaderc/third_party/spirv-tools/CMakeLists.txt
index 2a06a9ca39a61f5f3b618dc3f5655889a9dd38f4..e471b0bacf1bb04dc4c545e8dad4db0f4209f930 100644
--- a/lib/shaderc/third_party/spirv-tools/CMakeLists.txt
+++ b/lib/shaderc/third_party/spirv-tools/CMakeLists.txt
@@ -69,6 +69,8 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
add_definitions(-DSPIRV_HAIKU)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
add_definitions(-DSPIRV_SOLARIS)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SerenityOS")
+ add_definitions(-DSPIRV_LINUX)
else()
message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!")
endif()