From 825ab10c2130b65f50edbad46601f64b4cc8e0ec Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 2 Apr 2026 08:22:07 -0700
Subject: [PATCH] Moved macres to a separate directory
We don't need to build it as part of the Maelstrom build
---
maclib/CMakeLists.txt | 4 ----
macres/CMakeLists.txt | 20 ++++++++++++++++++++
macres/COPYING | 20 ++++++++++++++++++++
{maclib => macres}/macres.cpp | 2 ++
4 files changed, 42 insertions(+), 4 deletions(-)
create mode 100644 macres/CMakeLists.txt
create mode 100644 macres/COPYING
rename {maclib => macres}/macres.cpp (99%)
diff --git a/maclib/CMakeLists.txt b/maclib/CMakeLists.txt
index 98b28c8c..85e5942b 100644
--- a/maclib/CMakeLists.txt
+++ b/maclib/CMakeLists.txt
@@ -14,7 +14,3 @@ add_library(SDLmac STATIC
)
target_include_directories(SDLmac PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>")
target_link_libraries(SDLmac PRIVATE SDL3::SDL3)
-
-add_executable(macres macres.cpp)
-target_link_libraries(macres PRIVATE SDLmac)
-target_link_libraries(macres PRIVATE SDL3::SDL3)
diff --git a/macres/CMakeLists.txt b/macres/CMakeLists.txt
new file mode 100644
index 00000000..e43649cf
--- /dev/null
+++ b/macres/CMakeLists.txt
@@ -0,0 +1,20 @@
+cmake_minimum_required(VERSION 3.0...4.0)
+
+project(macres
+ LANGUAGES CXX
+ VERSION "1.0.0"
+)
+
+set(original_BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}")
+set(BUILD_SHARED_LIBS OFF)
+add_subdirectory(../external/SDL "${CMAKE_BINARY_DIR}/SDL" EXCLUDE_FROM_ALL)
+set(BUILD_SHARED_LIBS "${original_BUILD_SHARED_LIBS}")
+set_property(TARGET SDL3-static PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+
+add_subdirectory(../maclib "${CMAKE_BINARY_DIR}/maclib")
+set_property(TARGET SDLmac PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+
+add_executable(macres WIN32 macres.cpp)
+target_link_libraries(macres PRIVATE SDLmac)
+target_link_libraries(macres PRIVATE SDL3::SDL3-static)
+set_property(TARGET macres PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
diff --git a/macres/COPYING b/macres/COPYING
new file mode 100644
index 00000000..b2824c7e
--- /dev/null
+++ b/macres/COPYING
@@ -0,0 +1,20 @@
+/*
+ maclib: A companion library to SDL for working with Macintosh (tm) data
+ Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+*/
diff --git a/maclib/macres.cpp b/macres/macres.cpp
similarity index 99%
rename from maclib/macres.cpp
rename to macres/macres.cpp
index 4d8a0d4b..a6fb5950 100644
--- a/maclib/macres.cpp
+++ b/macres/macres.cpp
@@ -25,6 +25,8 @@
#include <limits.h> // For PATH_MAX
#include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
+
#include "Mac_Resource.h"
#include "Mac_Wave.h"