Merge pull request #105 from marcelofg55/windows_compile_fixes

Fix compile issues on Windows
pull/116/head
Thomas Herzog 2018-03-09 18:36:37 +01:00 committed by GitHub
commit 4a9e305776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -22,13 +22,6 @@ result_path = 'bin'
result_name = ARGUMENTS.get('n', ARGUMENTS.get('name', os.path.relpath('.', '..'))) result_name = ARGUMENTS.get('n', ARGUMENTS.get('name', os.path.relpath('.', '..')))
# This makes sure to keep the session environment variables on windows,
# that way you can run scons in a vs 2017 prompt and it will find all the required tools
env = Environment()
if target_platform == 'windows':
env = Environment(ENV = os.environ)
if target_platform == 'linux': if target_platform == 'linux':
result_name += '.linux.' + target_arch result_name += '.linux.' + target_arch
@ -47,6 +40,13 @@ if target_platform == 'linux':
env.Append(LINKFLAGS = [ '-m64' ]) env.Append(LINKFLAGS = [ '-m64' ])
elif target_platform == 'windows': elif target_platform == 'windows':
# This makes sure to keep the session environment variables on windows,
# that way you can run scons in a vs 2017 prompt and it will find all the required tools
if (target_arch == '64'):
env = Environment(ENV = os.environ, TARGET_ARCH='amd64')
else:
env = Environment(ENV = os.environ, TARGET_ARCH='x86')
result_name += '.windows.' + target_arch result_name += '.windows.' + target_arch
if host_platform == 'Windows': if host_platform == 'Windows':
@ -54,9 +54,9 @@ elif target_platform == 'windows':
env.Append(LINKFLAGS = [ '/WX' ]) env.Append(LINKFLAGS = [ '/WX' ])
if target == 'debug': if target == 'debug':
env.Append(CCFLAGS = ['-EHsc', '-D_DEBUG', '/MDd' ]) env.Append(CCFLAGS = ['/EHsc', '/D_DEBUG', '/MDd' ])
else: else:
env.Append(CCFLAGS = ['-O2', '-EHsc', '-DNDEBUG', '/MD' ]) env.Append(CCFLAGS = ['/O2', '/EHsc', '/DNDEBUG', '/MD' ])
else: else:
if target_arch == '32': if target_arch == '32':
env['CXX']='i686-w64-mingw32-g++' env['CXX']='i686-w64-mingw32-g++'