Support Visual Studio 2015 (MSVC 14.0), fixes #3439.

VS 2013 stays the default Windows compiler, but support for it will be
dropped as soon as possible.
Tested By: Stan
This was SVN commit r20562.
This commit is contained in:
Nicolas Auvray 2017-11-29 21:16:10 +00:00
parent 2da6c0ce2a
commit f22dfba717
5 changed files with 24 additions and 8 deletions

View File

@ -572,9 +572,18 @@ extern_lib_defs = {
add_default_lib_paths("nspr")
links { "nspr4", "plc4", "plds4" }
end
filter "Debug"
filter { "Debug", "action:vs2013" }
links { "mozjs38-ps-debug-vc120" }
filter { "Release", "action:vs2013" }
links { "mozjs38-ps-release-vc120" }
filter { "Debug", "action:vs2015" }
links { "mozjs38-ps-debug-vc140" }
filter { "Release", "action:vs2015" }
links { "mozjs38-ps-release-vc140" }
filter { "Debug", "action:not vs*" }
links { "mozjs38-ps-debug" }
filter "Release"
filter { "Release", "action:not vs*" }
links { "mozjs38-ps-release" }
filter { }
add_source_lib_paths("spidermonkey")

View File

@ -391,6 +391,8 @@ function project_create(project_name, target_type)
filter "action:vs2013"
toolset "v120_xp"
filter "action:vs2015"
toolset "v140_xp"
filter {}
project_set_target(project_name)
@ -595,7 +597,7 @@ function setup_all_libs ()
setup_third_party_static_lib_project("tinygettext", source_dirs, extern_libs, { } )
-- it's an external library and we don't want to modify its source to fix warnings, so we just disable them to avoid noise in the compile output
if _ACTION == "vs2013" then
filter "action:vs*"
buildoptions {
"/wd4127",
"/wd4309",
@ -605,7 +607,7 @@ function setup_all_libs ()
"/wd4099",
"/wd4503"
}
end
filter {}
if not _OPTIONS["without-lobby"] then
@ -850,11 +852,11 @@ function setup_all_libs ()
end
-- runtime-library-specific
if _ACTION == "vs2013" then
filter "action:vs*"
table.insert(source_dirs, "lib/sysdep/rtl/msc");
else
filter "action:not vs*"
table.insert(source_dirs, "lib/sysdep/rtl/gcc");
end
filter {}
setup_static_lib_project("lowlevel", source_dirs, extern_libs, extra_params)

View File

@ -3,4 +3,5 @@ rem ** Create Visual Studio Workspaces on Windows **
cd ..\premake
if not exist ..\workspaces\vc2013\SKIP_PREMAKE_HERE premake5\bin\release\premake5 --outpath="../workspaces/vc2013" --use-shared-glooxwrapper %* vs2013
if not exist ..\workspaces\vc2015\SKIP_PREMAKE_HERE premake5\bin\release\premake5 --outpath="../workspaces/vc2015" --use-shared-glooxwrapper %* vs2015
cd ..\workspaces

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2017 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -59,11 +59,13 @@ typedef enum
clockid_t;
// POSIX realtime clock_*
#if _MSC_VER < 1900
struct timespec
{
time_t tv_sec;
long tv_nsec;
};
#endif
extern int nanosleep(const struct timespec* rqtp, struct timespec* rmtp);
extern int clock_gettime(clockid_t clock, struct timespec* ts);

View File

@ -178,10 +178,12 @@ typedef struct {HANDLE signal, broadcast;} pthread_cond_t;
typedef DWORD pthread_t;
#define pid_t HANDLE // MINGW typedefs pid_t to int. Using #define here.
#if _MSC_VER < 1900
struct timespec {
long tv_nsec;
long tv_sec;
};
#endif
static int pthread_mutex_lock(pthread_mutex_t *);
static int pthread_mutex_unlock(pthread_mutex_t *);