forked from Mirrors/openclonk
MSVC: Remove support and workarounds for versions older than 2015
We require that version for its C++14 support anyway.objectmenu
parent
a19e7f6ced
commit
78e3457ff7
|
@ -59,20 +59,18 @@ if(USE_GCC_STD_14)
|
||||||
list(APPEND OC_CXX_FLAGS "-std=gnu++14")
|
list(APPEND OC_CXX_FLAGS "-std=gnu++14")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC_VERSION GREATER 1499)
|
if(MSVC)
|
||||||
list(APPEND OC_CXX_FLAGS /MP)
|
list(APPEND OC_CXX_FLAGS /MP)
|
||||||
list(REMOVE_ITEM OC_CXX_FLAGS_DEBUG /Gm)
|
list(REMOVE_ITEM OC_CXX_FLAGS_DEBUG /Gm)
|
||||||
|
|
||||||
if (NOT CMAKE_CL_64 OR NOT MSVC_VERSION VERSION_LESS 1900)
|
# Activate edit-and-continue
|
||||||
# Activate edit-and-continue
|
list(REMOVE_ITEM OC_CXX_FLAGS_DEBUG /Zi)
|
||||||
list(REMOVE_ITEM OC_CXX_FLAGS_DEBUG /Zi)
|
list(APPEND OC_CXX_FLAGS_DEBUG /ZI /Gy)
|
||||||
list(APPEND OC_CXX_FLAGS_DEBUG /ZI /Gy)
|
|
||||||
endif()
|
|
||||||
# do not link the release CRT in debug builds
|
# do not link the release CRT in debug builds
|
||||||
list(APPEND OC_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:MSVCRT")
|
list(APPEND OC_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")
|
||||||
endif()
|
|
||||||
if(MSVC_VERSION)
|
|
||||||
# Suppress warnings about "non-secure" functions
|
# Suppress warnings about "non-secure" functions
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
|
||||||
# Disable warning C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
# Disable warning C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
||||||
|
@ -1217,7 +1215,7 @@ endif()
|
||||||
# Precompiled header support for MSVC
|
# Precompiled header support for MSVC
|
||||||
############################################################################
|
############################################################################
|
||||||
if(HAVE_PRECOMPILED_HEADERS)
|
if(HAVE_PRECOMPILED_HEADERS)
|
||||||
if(MSVC_VERSION)
|
if(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)
|
||||||
|
@ -1274,14 +1272,6 @@ add_subdirectory(tests)
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
# CMake support for MSVC 2010 is broken. Change the .sln file to avoid
|
|
||||||
# millions of "reload X project?" dialog boxes.
|
|
||||||
# For best results, also change CMake's ReloadProjects macro to only
|
|
||||||
# call StopBuild().
|
|
||||||
if(MSVC_VERSION EQUAL 1600)
|
|
||||||
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln" "\n# reload me\n")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For MSVC 2015, add a Solution Items folder to the solution that contains
|
# For MSVC 2015, add a Solution Items folder to the solution that contains
|
||||||
# a reference to the debugger visualization file.
|
# a reference to the debugger visualization file.
|
||||||
if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015")
|
if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015")
|
||||||
|
|
|
@ -70,17 +70,9 @@ namespace re = std;
|
||||||
// because those libraries use placement new
|
// because those libraries use placement new
|
||||||
#ifndef NODEBUGMEM
|
#ifndef NODEBUGMEM
|
||||||
#if defined(_DEBUG) && defined(_MSC_VER)
|
#if defined(_DEBUG) && defined(_MSC_VER)
|
||||||
#if _MSC_VER <= 1200
|
|
||||||
#include <new>
|
|
||||||
#include <memory>
|
|
||||||
#include <crtdbg.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
#define malloc(size) ::_malloc_dbg(size, _NORMAL_BLOCK, __FILE__, __LINE__)
|
|
||||||
#else
|
|
||||||
#define _CRTDBG_MAP_ALLOC
|
#define _CRTDBG_MAP_ALLOC
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
#endif
|
|
||||||
inline void *operator new(size_t s, const char *szFile, long iLine)
|
inline void *operator new(size_t s, const char *szFile, long iLine)
|
||||||
{ return ::operator new(s, _NORMAL_BLOCK, szFile, iLine); }
|
{ return ::operator new(s, _NORMAL_BLOCK, szFile, iLine); }
|
||||||
inline void operator delete(void *p, const char *, long)
|
inline void operator delete(void *p, const char *, long)
|
||||||
|
|
|
@ -200,13 +200,6 @@ public:
|
||||||
inline C4Fixed operator * (float iVal2) const { return C4Fixed(*this) *= iVal2; }
|
inline C4Fixed operator * (float iVal2) const { return C4Fixed(*this) *= iVal2; }
|
||||||
inline C4Fixed operator / (float iVal2) const { return C4Fixed(*this) /= iVal2; }
|
inline C4Fixed operator / (float iVal2) const { return C4Fixed(*this) /= iVal2; }
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1200
|
|
||||||
inline C4Fixed operator + (int iVal2) const { return operator + (int32_t(iVal2)); }
|
|
||||||
inline C4Fixed operator - (int iVal2) const { return operator - (int32_t(iVal2)); }
|
|
||||||
inline C4Fixed operator * (int iVal2) const { return operator * (int32_t(iVal2)); }
|
|
||||||
inline C4Fixed operator / (int iVal2) const { return operator / (int32_t(iVal2)); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
inline bool operator == (int32_t iVal2) const { return operator == (C4Fixed(iVal2)); }
|
inline bool operator == (int32_t iVal2) const { return operator == (C4Fixed(iVal2)); }
|
||||||
inline bool operator < (int32_t iVal2) const { return operator < (C4Fixed(iVal2)); }
|
inline bool operator < (int32_t iVal2) const { return operator < (C4Fixed(iVal2)); }
|
||||||
inline bool operator > (int32_t iVal2) const { return operator > (C4Fixed(iVal2)); }
|
inline bool operator > (int32_t iVal2) const { return operator > (C4Fixed(iVal2)); }
|
||||||
|
@ -221,15 +214,6 @@ public:
|
||||||
inline bool operator >= (float iVal2) const { return operator >= (C4Fixed(iVal2)); }
|
inline bool operator >= (float iVal2) const { return operator >= (C4Fixed(iVal2)); }
|
||||||
inline bool operator != (float iVal2) const { return operator != (C4Fixed(iVal2)); }
|
inline bool operator != (float iVal2) const { return operator != (C4Fixed(iVal2)); }
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1200
|
|
||||||
inline bool operator == (int iVal2) const { return operator == (C4Fixed(int32_t(iVal2))); }
|
|
||||||
inline bool operator < (int iVal2) const { return operator < (C4Fixed(int32_t(iVal2))); }
|
|
||||||
inline bool operator > (int iVal2) const { return operator > (C4Fixed(int32_t(iVal2))); }
|
|
||||||
inline bool operator <= (int iVal2) const { return operator <= (C4Fixed(int32_t(iVal2))); }
|
|
||||||
inline bool operator >= (int iVal2) const { return operator >= (C4Fixed(int32_t(iVal2))); }
|
|
||||||
inline bool operator != (int iVal2) const { return operator != (C4Fixed(int32_t(iVal2))); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef C4REAL_USE_FIXNUM
|
#ifdef C4REAL_USE_FIXNUM
|
||||||
C4Fixed sin_deg() const
|
C4Fixed sin_deg() const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue