Commit fe79d1a3 authored by Florian Oetke's avatar Florian Oetke
Browse files

Merge branch 'feature/windows_and_msvc_support' into 'develop'

Feature/windows and msvc support

See merge request lowkey42/mirrage!12
parents 57d23603 75377eab
Pipeline #2613 passed with stage
in 13 minutes and 29 seconds
......@@ -60,6 +60,10 @@ endif()
if(NOT TARGET mirrage::deps::SDL2)
message("Building SDL2 from source")
add_subdirectory(SDL)
if(MSVC)
target_compile_options(SDL2 PRIVATE /wd4267 /wd4018)
target_compile_options(SDL2-static PRIVATE /wd4267 /wd4018)
endif()
add_library(mirrage::deps::SDL2 ALIAS SDL2-static)
add_library(mirrage::deps::SDL2main ALIAS SDL2main)
endif()
......
......@@ -72,7 +72,11 @@ target_include_directories(enet PUBLIC
$<INSTALL_INTERFACE:include>)
if(WIN32)
target_link_libraries(enet winmm ws2_32)
target_link_libraries(enet PUBLIC winmm ws2_32)
endif()
if(MSVC)
target_compile_definitions(enet PRIVATE _WINSOCK_DEPRECATED_NO_WARNINGS)
endif()
install(TARGETS enet EXPORT enetTargets
......
......@@ -55,7 +55,9 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-Wno-missing-braces)
elseif(MSVC)
set(MIRRAGE_DEFAULT_COMPILER_ARGS /DWIN32_LEAN_AND_MEAN /DNOMINMAX /MP)
set(MIRRAGE_DEFAULT_COMPILER_ARGS /DWIN32_LEAN_AND_MEAN /DNOMINMAX /MP /W3 /WX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4221")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
endif()
# Select optimal linker
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment