shithub: cstory

Download patch

ref: 4d9bc0a65fc88c883af48e062f458c7a0c877cb0
parent: bde0c979ffdd2d49f239770965e94929bf63110e
author: Clownacy <[email protected]>
date: Sat Apr 13 17:25:46 EDT 2019

Remove the WINDOWS CMake option, and just detect Windows instead

Also remove the STATIC option from MSVC because why wouldn't you

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,6 @@
 option(STATIC "Produce a statically-linked executable (good for Windows builds, so you don't need to bundle DLL files)" OFF)
 option(JAPANESE "Enable the Japanese-language build" OFF)
 option(FIX_BUGS "Fix certain bugs (see src/Bug Fixes.txt)" OFF)
-option(WINDOWS "Enable Windows-only features like a unique file/taskbar icon, and system font loading (needed for the font setting in Config.dat to do anything)" OFF)
 option(RASPBERRY_PI "Enable tweaks to improve performance on Raspberry Pis" OFF)
 option(NONPORTABLE "Enable bits of code that aren't portable, but are what the original game used" OFF)
 
@@ -231,13 +230,6 @@
 	target_compile_definitions(CSE2 PRIVATE FIX_BUGS)
 endif()
 
-if (WINDOWS)
-	target_sources(CSE2 PRIVATE "res/ICON/ICON.rc")
-	target_compile_definitions(CSE2 PRIVATE WINDOWS)
-else()
-	list(APPEND RESOURCES "ICON/ICON_MINI.bmp")
-endif()
-
 if (RASPBERRY_PI)
 	target_compile_definitions(CSE2 PRIVATE RASPBERRY_PI)
 endif()
@@ -246,6 +238,15 @@
 	target_compile_definitions(CSE2 PRIVATE NONPORTABLE)
 endif()
 
+# Make some tweaks if we're targetting Windows
+if (WIN32)
+	target_sources(CSE2 PRIVATE "res/ICON/ICON.rc")
+	target_compile_definitions(CSE2 PRIVATE WINDOWS)
+	set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES)	# Disable the console window
+else()
+	list(APPEND RESOURCES "ICON/ICON_MINI.bmp")
+endif()
+
 # Magic to convert resources to header files
 add_executable(bin2h res/bin2h.c)
 foreach(FILENAME IN LISTS RESOURCES)
@@ -268,10 +269,6 @@
 	if (result)
 		set_target_properties(CSE2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
 	endif()
-endif()
-
-if (WIN32)
-	set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES)	# Disable the console window
 endif()
 
 if (MSVC)