Improvements to scons defined WINVER/_WIN32_WINNT
This commit is contained in:
parent
ad224295c0
commit
65483d57bf
4 changed files with 12 additions and 14 deletions
|
@ -33,10 +33,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef WINDOWS_ENABLED
|
#ifdef WINDOWS_ENABLED
|
||||||
// Workaround mingw missing flags!
|
|
||||||
#ifndef AI_ADDRCONFIG
|
|
||||||
#define AI_ADDRCONFIG 0x00000400
|
|
||||||
#endif
|
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
|
@ -3,17 +3,13 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef WINDOWS_ENABLED
|
#if defined(__MINGW32__ ) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 4)
|
||||||
// Workaround mingw missing flags!
|
// Workaround for mingw-w64 < 4.0
|
||||||
#ifndef IPV6_V6ONLY
|
#ifndef IPV6_V6ONLY
|
||||||
#define IPV6_V6ONLY 27
|
#define IPV6_V6ONLY 27
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef UWP_ENABLED
|
|
||||||
#define in6addr_any IN6ADDR_ANY_INIT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// helpers for sockaddr -> IP_Address and back, should work for posix and winsock. All implementations should use this
|
// helpers for sockaddr -> IP_Address and back, should work for posix and winsock. All implementations should use this
|
||||||
|
|
||||||
static size_t _set_sockaddr(struct sockaddr_storage* p_addr, const IP_Address& p_ip, int p_port, IP::Type p_sock_type = IP::TYPE_ANY) {
|
static size_t _set_sockaddr(struct sockaddr_storage* p_addr, const IP_Address& p_ip, int p_port, IP::Type p_sock_type = IP::TYPE_ANY) {
|
||||||
|
|
|
@ -145,9 +145,13 @@ def configure(env):
|
||||||
|
|
||||||
env.Append(CCFLAGS=['/DGLES2_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED'])
|
env.Append(CCFLAGS=['/DGLES2_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED'])
|
||||||
|
|
||||||
|
winver = "0x0602" # Windows 8 is the minimum target for UWP build
|
||||||
|
env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver])
|
||||||
|
|
||||||
LIBS = [
|
LIBS = [
|
||||||
'WindowsApp',
|
'WindowsApp',
|
||||||
'mincore',
|
'mincore',
|
||||||
|
'ws2_32',
|
||||||
'libANGLE',
|
'libANGLE',
|
||||||
'libEGL',
|
'libEGL',
|
||||||
'libGLESv2',
|
'libGLESv2',
|
||||||
|
|
|
@ -209,7 +209,7 @@ def configure(env):
|
||||||
env.Append(CPPPATH=['#platform/windows'])
|
env.Append(CPPPATH=['#platform/windows'])
|
||||||
|
|
||||||
# Targeted Windows version: Vista (and later)
|
# Targeted Windows version: Vista (and later)
|
||||||
env.Append(CPPFLAGS=['-D_WIN32_WINNT=0x0600'])
|
winver = "0x0600" # Windows Vista is the minimum target for windows builds
|
||||||
|
|
||||||
env['is_mingw'] = False
|
env['is_mingw'] = False
|
||||||
if (os.name == "nt" and os.getenv("VCINSTALLDIR")):
|
if (os.name == "nt" and os.getenv("VCINSTALLDIR")):
|
||||||
|
@ -217,6 +217,7 @@ def configure(env):
|
||||||
env['ENV']['TMP'] = os.environ['TMP']
|
env['ENV']['TMP'] = os.environ['TMP']
|
||||||
env.Append(CPPPATH=['#platform/windows/include'])
|
env.Append(CPPPATH=['#platform/windows/include'])
|
||||||
env.Append(LIBPATH=['#platform/windows/lib'])
|
env.Append(LIBPATH=['#platform/windows/lib'])
|
||||||
|
env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver])
|
||||||
|
|
||||||
if (env["target"] == "release"):
|
if (env["target"] == "release"):
|
||||||
|
|
||||||
|
@ -311,6 +312,7 @@ def configure(env):
|
||||||
env.use_windows_spawn_fix()
|
env.use_windows_spawn_fix()
|
||||||
|
|
||||||
# build using mingw
|
# build using mingw
|
||||||
|
env.Append(CCFLAGS=['-DWINVER=%s' % winver, '-D_WIN32_WINNT=%s' % winver])
|
||||||
if (os.name == "nt"):
|
if (os.name == "nt"):
|
||||||
env['ENV']['TMP'] = os.environ['TMP'] # way to go scons, you can be so stupid sometimes
|
env['ENV']['TMP'] = os.environ['TMP'] # way to go scons, you can be so stupid sometimes
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue