ladybird/Ports/genemu/patches/0001-Manually-link-against-SDL2.patch
Ali Mohammad Pur 2f58fe00bd Ports: Update genemu's patches to use git patches
This required splitting the single patch file up, which was done with
_some_ degree of accuracy (but not entirely so).
2022-05-19 20:17:10 +04:30

40 lines
1.4 KiB
Diff

From 056b239a373a1ff7dafd50e75f5c08331d1fcb52 Mon Sep 17 00:00:00 2001
From: aabajyan <arsen.abajyan@pm.me>
Date: Sun, 7 Mar 2021 22:30:13 +0400
Subject: [PATCH 1/5] Manually link against SDL2
---
CMakeLists.txt | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94ae8ef..a9a974c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,17 @@
cmake_minimum_required(VERSION 2.6)
-set(CMAKE_BUILD_TYPE "Debug")
-
INCLUDE(FindPkgConfig)
-PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
-INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS})
+find_package(SDL2 REQUIRED)
-set_source_files_properties( mem.cpp PROPERTIES COMPILE_FLAGS " -O0 -UNDEBUG " )
+set_source_files_properties( mem.cpp PROPERTIES COMPILE_FLAGS " -Og")
add_executable(genemu genemu.cpp cpu.cpp vdp.cpp mem.cpp state.cpp gfx.cpp ioports.cpp hw.c Z80/Z80.c m68k/m68kcpu.c m68k/m68kops.c m68k/m68kopac.c m68k/m68kopdm.c m68k/m68kopnz.c m68k/m68kdasm.c ym2612/ym2612.c)
-target_link_libraries(genemu ${SDL2_LIBRARIES})
+target_include_directories(genemu SYSTEM PRIVATE ${SDL2_INCLUDE_DIRS})
+
+if("${SDL2_LIBRARIES}" STREQUAL "")
+ message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
+ set(SDL2_LIBRARIES "SDL2::SDL2")
+endif()
+
+target_link_libraries(genemu PRIVATE ${SDL2_LIBRARIES})
+
+install(TARGETS genemu RUNTIME DESTINATION bin)
--
2.36.1