From 4d9bc0a65fc88c883af48e062f458c7a0c877cb0 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sat, 13 Apr 2019 21:25:46 +0100 Subject: [PATCH] Remove the WINDOWS CMake option, and just detect Windows instead Also remove the STATIC option from MSVC because why wouldn't you --- CMakeLists.txt | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6274e250..87c4ecb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.12) 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 @@ if (FIX_BUGS) 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 @@ if (NONPORTABLE) 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) @@ -270,10 +271,6 @@ if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") endif() endif() -if (WIN32) - set_target_properties(CSE2 PROPERTIES WIN32_EXECUTABLE YES) # Disable the console window -endif() - if (MSVC) if (STATIC) message(STATUS "STATIC option doesn't affect MSVC builds")