Make compiling using MSVC work

This commit is contained in:
sfan5 2021-03-26 16:48:28 +01:00
parent f7b46ba22f
commit 279530a230
2 changed files with 3 additions and 9 deletions

@ -184,7 +184,7 @@ _IRR_COMPILE_WITH_DX9_DEV_PACK_. So you simply need to add something like this
to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK
and this to the linker settings: -ld3dx9
*/
#if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))
#if defined(_IRR_WINDOWS_API_) && defined(IRR_COMPILE_WITH_DX9_DEV_PACK)
//! Define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ if you want to use DirectInput for joystick handling.
/** This only applies to Windows devices, currently only supported under Win32 device.

@ -18,15 +18,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
add_compile_options(-Wall -pipe -fno-exceptions -fno-rtti)
elseif(MSVC)
# entirely untested
set(CMAKE_CXX_FLAGS_RELEASE "/GL /MT /Ox")
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /RTC1 /Zi")
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " msvcrt.lib") # ???? fuck off
set(CMAKE_CXX_FLAGS "/Gd /GF /GR- /GS /Gy /Zl")
set(CMAKE_EXE_LINKER_FLAGS "/nologo")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS /OPT:REF /LTCG")
add_compile_options(/GR- /Zl)
endif()
# Required libs