From 99f8b1457bcf7fa6dc4d0354c4918ef341e4318c Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 5 Oct 2023 14:37:02 +0300
Subject: [PATCH] cmake: make unrar-depending RSN an option
---
CMakeLists.txt | 4 ++++
gme/CMakeLists.txt | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aca1ea9..2615ad5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,6 +46,10 @@ if (NOT DEFINED USE_GME_SPC)
SET(USE_GME_SPC 1 CACHE BOOL "Enable SNES SPC music emulation")
endif()
+if (NOT DEFINED GME_UNRAR_RSN)
+ option(GME_UNRAR_RSN "Enable SPC RSN format (optional, requires UnRAR library)" ON)
+endif()
+
if (NOT DEFINED GME_SPC_ISOLATED_ECHO_BUFFER)
option(GME_SPC_ISOLATED_ECHO_BUFFER "Enable isolated echo buffer on SPC emulator to allow correct playing of \"dodgy\" SPC files made for various ROM hacks ran on ZSNES" OFF)
endif()
diff --git a/gme/CMakeLists.txt b/gme/CMakeLists.txt
index 46a58bd..5050f04 100644
--- a/gme/CMakeLists.txt
+++ b/gme/CMakeLists.txt
@@ -181,7 +181,7 @@ else()
message("ZLib library not found, disabling support for compressed formats such as VGZ")
endif()
-if(USE_GME_SPC)
+if(USE_GME_SPC AND GME_UNRAR_RSN)
if(UNRAR_FOUND)
message(" ** unRAR library located, the RSN file format will be supported")
target_compile_definitions(gme PRIVATE -DRARDLL)