From 1ffc5939931e07dcc3d5688ec6848d2cd76e2ab3 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 31 May 2019 02:59:45 +0300 Subject: [PATCH 1/2] wscript: check for 64-bit only for Win/Linux/Mac and only on amd64 It's useless to force 32-bit code for everything, as GoldSrc exists only for Intel CPUs and Windows, Linux or OSX --- wscript | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wscript b/wscript index cb86ef97..a1ae81e4 100644 --- a/wscript +++ b/wscript @@ -109,19 +109,19 @@ def configure(conf): conf.options.GLWES = True conf.options.GL = False - # print(conf.options.ALLOW64) - - conf.env.BIT32_MANDATORY = not conf.options.ALLOW64 - conf.env.BIT32_ALLOW64 = conf.options.ALLOW64 + # We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture + # Because compatibility with original GoldSrc + if conf.env.DEST_OS in ['win32', 'linux', 'darwin'] and conf.env.DEST_CPU in ['x86_64']: + conf.env.BIT32_ALLOW64 = conf.options.ALLOW64 + if not conf.env.BIT32_ALLOW64: + Logs.info('WARNING: will build engine for 32-bit target') + else: + conf.env.BIT32_ALLOW64 = True + conf.env.BIT32_MANDATORY = not conf.env.BIT32_ALLOW64 conf.load('force_32bit') if conf.env.DEST_OS2 != 'android': conf.load('sdl2') - if conf.env.DEST_SIZEOF_VOID_P == 4: - Logs.info('NOTE: will build engine for 32-bit target') - else: - Logs.warn('WARNING: 64-bit engine may be unstable') - linker_flags = { 'common': { 'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries From 37181e410fb1fe7c2579fa89739c100a7676a90b Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 1 Jun 2019 19:26:55 +0500 Subject: [PATCH 2/2] waflib: fix wrong identation. --- scripts/waflib/gitversion.py | 4 ++-- scripts/waflib/xcompile.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/waflib/gitversion.py b/scripts/waflib/gitversion.py index 7b4025a1..b26316b0 100644 --- a/scripts/waflib/gitversion.py +++ b/scripts/waflib/gitversion.py @@ -22,8 +22,8 @@ def get_git_version(): except Exception as e: pass - if(len(version) == 0): - version = None + if(len(version) == 0): + version = None return version diff --git a/scripts/waflib/xcompile.py b/scripts/waflib/xcompile.py index c30ec2bf..d4d60d9d 100644 --- a/scripts/waflib/xcompile.py +++ b/scripts/waflib/xcompile.py @@ -76,8 +76,8 @@ class Android: self.toolchain = toolchain - if self.ndk_rev >= 19 or 'clang' in self.toolchain: - self.clang = True + if self.ndk_rev >= 19 or 'clang' in self.toolchain: + self.clang = True if self.is_arm64() or self.is_amd64() and self.api < 21: Logs.warn('API level for 64-bit target automatically was set to 21')