forked from Mirrors/openclonk
Win32: Fix build with MSVC's Clang-based toolset
Well, somewhat. I can't get Clang/C2 to build Qt so I can't build OC with Qt support.alut-include-path
parent
c2ae62975a
commit
561e083181
|
@ -124,8 +124,16 @@ if(USE_GCC_STYLE_LTCG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Disable non-standard conversion from string literal to (nonconst) char*
|
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:strictStrings")
|
# Set up some additional flags only if we're using the MS compiler,
|
||||||
|
# and not the clang-based toolchain
|
||||||
|
|
||||||
|
# Disable non-standard conversion from string literal to (nonconst) char*
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:strictStrings")
|
||||||
|
|
||||||
|
# Activate edit-and-continue
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI /Gy")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Enable multi-core builds
|
# Enable multi-core builds
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
|
@ -135,9 +143,6 @@ if(MSVC)
|
||||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Ob2 /GL")
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Ob2 /GL")
|
||||||
add_linker_flags(optimized MODULES exe shared static FLAGS "/LTCG:incremental")
|
add_linker_flags(optimized MODULES exe shared static FLAGS "/LTCG:incremental")
|
||||||
|
|
||||||
# Activate edit-and-continue
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI /Gy")
|
|
||||||
|
|
||||||
# do not link the release CRT in debug builds
|
# do not link the release CRT in debug builds
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT")
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT")
|
||||||
set(HAVE_PRECOMPILED_HEADERS ON CACHE INTERNAL "Compiler supports precompiled headers")
|
set(HAVE_PRECOMPILED_HEADERS ON CACHE INTERNAL "Compiler supports precompiled headers")
|
||||||
|
@ -1301,7 +1306,7 @@ endif()
|
||||||
# Precompiled header support for MSVC
|
# Precompiled header support for MSVC
|
||||||
############################################################################
|
############################################################################
|
||||||
if(HAVE_PRECOMPILED_HEADERS)
|
if(HAVE_PRECOMPILED_HEADERS)
|
||||||
if(MSVC)
|
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
get_property(OC_SOURCES TARGET openclonk PROPERTY SOURCES)
|
get_property(OC_SOURCES TARGET openclonk PROPERTY SOURCES)
|
||||||
foreach(FILE ${OC_SOURCES})
|
foreach(FILE ${OC_SOURCES})
|
||||||
get_filename_component(FILE_EXT ${FILE} EXT)
|
get_filename_component(FILE_EXT ${FILE} EXT)
|
||||||
|
|
|
@ -1010,7 +1010,7 @@ bool C4AbstractApp::SetVideoMode(int iXRes, int iYRes, unsigned int iRefreshRate
|
||||||
dspMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
dspMode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||||
if (iRefreshRate != 0)
|
if (iRefreshRate != 0)
|
||||||
dspMode.dmFields |= DM_DISPLAYFREQUENCY;
|
dspMode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||||
DWORD rv = ChangeDisplaySettingsExW(iMonitor ? Mon.GetWideChar() : nullptr, &dspMode, nullptr, CDS_FULLSCREEN, nullptr);
|
LONG rv = ChangeDisplaySettingsExW(iMonitor ? Mon.GetWideChar() : nullptr, &dspMode, nullptr, CDS_FULLSCREEN, nullptr);
|
||||||
if (rv != DISP_CHANGE_SUCCESSFUL)
|
if (rv != DISP_CHANGE_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
switch (rv)
|
switch (rv)
|
||||||
|
|
Loading…
Reference in New Issue