Merge pull request #26052 from marcelofg55/mingw_cfix_win

Fix compiling with use_mingw flag on Windows
This commit is contained in:
Rémi Verschelde 2019-02-19 14:14:51 +01:00 committed by GitHub
commit b7c50d99af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,6 @@ def get_opts():
return [ return [
('msvc_version', 'MSVC version to use (ignored if the VCINSTALLDIR environment variable is set)', None), ('msvc_version', 'MSVC version to use (ignored if the VCINSTALLDIR environment variable is set)', None),
BoolVariable('use_mingw', 'Use the MinGW compiler even if MSVC is installed (only used on Windows)', False),
] ]

View File

@ -347,12 +347,12 @@ def configure(env):
env['ENV']['TMP'] = os.environ['TMP'] env['ENV']['TMP'] = os.environ['TMP']
# First figure out which compiler, version, and target arch we're using # First figure out which compiler, version, and target arch we're using
if os.getenv("VCINSTALLDIR"): if os.getenv("VCINSTALLDIR") and not env["use_mingw"]:
# Manual setup of MSVC # Manual setup of MSVC
setup_msvc_manual(env) setup_msvc_manual(env)
env.msvc = True env.msvc = True
manual_msvc_config = True manual_msvc_config = True
elif env.get('MSVC_VERSION', ''): elif env.get('MSVC_VERSION', '') and not env["use_mingw"]:
setup_msvc_auto(env) setup_msvc_auto(env)
env.msvc = True env.msvc = True
manual_msvc_config = False manual_msvc_config = False