From 279530a23076119ed744fe00cd19128cb2989d66 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 26 Mar 2021 16:48:28 +0100 Subject: [PATCH] Make compiling using MSVC work --- include/IrrCompileConfig.h | 2 +- source/Irrlicht/CMakeLists.txt | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h index f9f98020..77c4ab11 100644 --- a/include/IrrCompileConfig.h +++ b/include/IrrCompileConfig.h @@ -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. diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 7198bb29..28301c5b 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -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