From e080c5391ee7697fd5b4b389ba9d0314c209dfba Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sat, 25 May 2019 15:23:36 +0300 Subject: [PATCH] Fix MinGW-w64 cross-compilation on macOS. --- SConstruct | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 116a3d74..99475e42 100644 --- a/SConstruct +++ b/SConstruct @@ -151,15 +151,21 @@ elif env['platform'] == 'windows': elif env['target'] == 'release': env.Append(CCFLAGS=['/O2', '/EHsc', '/DNDEBUG', '/MD']) - elif host_platform == 'linux': + elif host_platform == 'linux' or host_platform == 'osx': # Cross-compilation using MinGW if env['bits'] == '64': env['CXX'] = 'x86_64-w64-mingw32-g++' + env['AR'] = "x86_64-w64-mingw32-ar" + env['RANLIB'] = "x86_64-w64-mingw32-ranlib" + env['LINK'] = "x86_64-w64-mingw32-g++" elif env['bits'] == '32': env['CXX'] = 'i686-w64-mingw32-g++' + env['AR'] = "i686-w64-mingw32-ar" + env['RANLIB'] = "i686-w64-mingw32-ranlib" + env['LINK'] = "i686-w64-mingw32-g++" # Native or cross-compilation using MinGW - if host_platform == 'linux' or env['use_mingw']: + if host_platform == 'linux' or host_platform == 'osx' or env['use_mingw']: env.Append(CCFLAGS=['-g', '-O3', '-std=c++14', '-Wwrite-strings']) env.Append(LINKFLAGS=[ '--static',