Remove the STATIC option from the CMake file

Instead it just automatically does static linking if it detects MSYS
This commit is contained in:
Clownacy 2019-04-20 04:43:56 +01:00
parent 5cf7c95dd7
commit 014d128396

View file

@ -4,7 +4,6 @@ if ((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.
cmake_policy(SET CMP0069 NEW)
endif()
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(NONPORTABLE "Enable bits of code that aren't portable, but are what the original game used" OFF)
@ -311,9 +310,7 @@ if (MSVC)
# Shut up those stupid warnings
target_compile_definitions(CSE2 PRIVATE _CRT_SECURE_NO_WARNINGS)
else()
# Find dependencies
if (STATIC)
elseif (MSYS)
# Fall back on pkg-config, since cmake's static support sucks
find_package(PkgConfig REQUIRED)
@ -328,14 +325,13 @@ else()
set(FREETYPE_LIBRARIES ${FREETYPE_STATIC_LIBRARIES})
target_link_libraries(CSE2 -static)
else()
else()
# SDL2 has no standard way of being used by cmake, so avoid
# that mess entirely and just use pkg-config instead
find_package(PkgConfig REQUIRED)
pkg_check_modules(SDL2 REQUIRED sdl2)
find_package(Freetype REQUIRED)
endif()
endif()
target_include_directories(CSE2 PRIVATE ${SDL2_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})