Fix Windows build

This commit is contained in:
Deukhoofd 2019-10-23 18:13:37 +02:00
parent d580d81163
commit bc7c42c50d
1 changed files with 1 additions and 13 deletions

View File

@ -1,18 +1,5 @@
cmake_minimum_required(VERSION 3.13)
# If a defined C Compiler is not set
if (NOT CMAKE_C_COMPILER)
# If the GCC flag is set, use GCC
if (GCC)
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
# Otherwise default to clang
else()
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
endif(GCC)
endif(NOT CMAKE_C_COMPILER)
# Make warnings trigger errors.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
@ -51,6 +38,7 @@ target_link_libraries(CreatureLibBattling CreatureLibLibrary)
target_link_libraries(CreatureLibTests CreatureLibLibrary)
if (WINDOWS)
set (CMAKE_CXX_FLAGS "-Wl,-allow-multiple-definition")
# Statically link libraries we need in Windows.
target_link_libraries(CreatureLibCore -static -static-libgcc -static-libstdc++)
target_link_libraries(CreatureLibLibrary -static -static-libgcc -static-libstdc++)