Fix Windows build
This commit is contained in:
parent
d580d81163
commit
bc7c42c50d
|
@ -1,18 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.13)
|
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.
|
# Make warnings trigger errors.
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
|
||||||
|
|
||||||
|
@ -51,6 +38,7 @@ target_link_libraries(CreatureLibBattling CreatureLibLibrary)
|
||||||
target_link_libraries(CreatureLibTests CreatureLibLibrary)
|
target_link_libraries(CreatureLibTests CreatureLibLibrary)
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
|
set (CMAKE_CXX_FLAGS "-Wl,-allow-multiple-definition")
|
||||||
# Statically link libraries we need in Windows.
|
# Statically link libraries we need in Windows.
|
||||||
target_link_libraries(CreatureLibCore -static -static-libgcc -static-libstdc++)
|
target_link_libraries(CreatureLibCore -static -static-libgcc -static-libstdc++)
|
||||||
target_link_libraries(CreatureLibLibrary -static -static-libgcc -static-libstdc++)
|
target_link_libraries(CreatureLibLibrary -static -static-libgcc -static-libstdc++)
|
||||||
|
|
Loading…
Reference in New Issue