Skip to content

Commit

Permalink
Added Visual Studio 2017 support
Browse files Browse the repository at this point in the history
  • Loading branch information
imdex committed Jun 10, 2017
1 parent 54ddee7 commit 7c6d8f1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 10 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ else()
endif()

if (MSVC)
if (MSVC_VERSION EQUAL 1900)
if (MSVC_VERSION EQUAL 1900) #MSVS 2015
set(VS_TOOLS_PATH $ENV{VS140COMNTOOLS})
set(VC_ENV_BAT ${VS_TOOLS_PATH}../../VC/vcvarsall.bat)
elseif(MSVC_VERSION EQUAL 1910) # MSVS 2017
execute_process(COMMAND "vswhere" "-version" "15.0" "-property" "installationPath"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE VS_TOOLS_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(VC_ENV_BAT ${VS_TOOLS_PATH}/VC/Auxiliary/Build/vcvarsall.bat)
else()
message(FATAL_ERROR "Only MSVC 14.0 (MSVS 2015) is supported")
message(FATAL_ERROR "Only MSVC 14.x (MSVS 2015) and MSVC 15.x (MSVS 2017) is supported")
endif()
else()
message(FATAL_ERROR "Only MSVC compiler is supported")
Expand Down
4 changes: 2 additions & 2 deletions code/engine/xrCore/_stl_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class xalloc {
char* _charalloc(size_type n) { return (char*)allocate(n); }
void deallocate(pointer p, size_type n) const { xr_free(p); }
void deallocate(void* p, size_type n) const { xr_free(p); }
void construct(pointer p, const T& _Val) { std::_Construct(p, _Val); }
void destroy(pointer p) { std::_Destroy(p); }
void construct(pointer p, const T& _Val) { new(p) T(_Val); }
void destroy(pointer p) { p->~T(); }
size_type max_size() const
{
size_type _Count = (size_type)(-1) / sizeof(T);
Expand Down
1 change: 1 addition & 0 deletions code/engine/xrCore/cpuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <array>
#include <bitset>
#include <memory>
#include <intrin.h>

/***
*
Expand Down
4 changes: 1 addition & 3 deletions code/engine/xrCore/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include <time.h>
#include "resource.h"
#include "log.h"
#ifdef _EDITOR
#include "malloc.h"
#endif
#include "malloc.h"

extern BOOL LogExecCB = TRUE;
static string_path logFName = "engine.log";
Expand Down
1 change: 1 addition & 0 deletions code/engine/xrCore/os_clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "stdafx.h"
#pragma hdrstop
#include "os_clipboard.h"
#include <malloc.h>

void os_clipboard::copy_to_clipboard ( LPCSTR buf )
{
Expand Down
2 changes: 2 additions & 0 deletions code/engine/xrCore/string_concatenations.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef STRING_CONCATENATIONS_H
#define STRING_CONCATENATIONS_H

#include <malloc.h>

#ifndef _EDITOR

LPSTR XRCORE_API strconcat ( int dest_sz, char* dest, const char* S1, const char* S2);
Expand Down
2 changes: 1 addition & 1 deletion code/engine/xrCore/xrDebugNew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void xrDebug::gather_info (const char *expression, const char *description, con
Msg ("%s",StackTrace[i]);

#ifdef USE_OWN_ERROR_MESSAGE_WINDOW
buffer += xr_sprintf(buffer,assertion_size - u32(buffer - buffer_base),"%s%s",g_stackTrace[i],endline);
buffer += xr_sprintf(buffer,assertion_size - u32(buffer - buffer_base),"%s%s",StackTrace[i],endline);
#endif // USE_OWN_ERROR_MESSAGE_WINDOW
}

Expand Down
4 changes: 2 additions & 2 deletions code/engine/xrRenderCommon/r__dsgraph_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
void deallocate (pointer p, size_type n) const { g_render_lua_allocator.free_impl ((void*&)p); }
void deallocate (void* p, size_type n) const { g_render_lua_allocator.free_impl (p); }
char* __charalloc (size_type n) { return (char*)allocate(n); }
void construct (pointer p, const T& _Val) { std::_Construct(p, _Val); }
void destroy (pointer p) { std::_Destroy(p); }
void construct (pointer p, const T& _Val) { new(p) T(_Val); }
void destroy (pointer p) { p->~T(); }
size_type max_size () const { size_type _Count = (size_type)(-1) / sizeof (T); return (0 < _Count ? _Count : 1); }
};

Expand Down
Binary file added vswhere.exe
Binary file not shown.

0 comments on commit 7c6d8f1

Please sign in to comment.