diff options
author | George Marques <george@gmarqu.es> | 2016-10-28 20:57:51 -0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-28 20:57:51 -0200 |
commit | a52cbd65a8cc512c0292daedac59c3d7f1900286 (patch) | |
tree | a56edbd479d39b6fea46ea9e72a1902379bdd221 | |
parent | 8321e48ab0ac0700e1aef8f829140052c1ba4c6d (diff) | |
parent | f7773d499dcd1d9580616dd1ba03f7382ac44cae (diff) |
Merge pull request #6937 from SuperUserNameMan/fix_win_standalone_msvc_and_mingw_incompatibilities
fix bug introduced by #6501
-rw-r--r-- | SConstruct | 2 | ||||
-rwxr-xr-x | methods.py | 5 | ||||
-rw-r--r-- | modules/openssl/SCsub | 2 | ||||
-rw-r--r-- | platform/windows/detect.py | 26 |
4 files changed, 15 insertions, 20 deletions
diff --git a/SConstruct b/SConstruct index 72de2e2004..365463ebad 100644 --- a/SConstruct +++ b/SConstruct @@ -61,7 +61,7 @@ platform_arg = ARGUMENTS.get("platform", ARGUMENTS.get("p", False)) if (os.name=="posix"): pass elif (os.name=="nt"): - if (not methods.msvc_is_detected() or platform_arg=="android"): + if ( os.getenv("VCINSTALLDIR")==None or platform_arg=="android"): custom_tools=['mingw'] env_base=Environment(tools=custom_tools); diff --git a/methods.py b/methods.py index 477fe4f12f..bd5409e3d4 100755 --- a/methods.py +++ b/methods.py @@ -1516,11 +1516,6 @@ def detect_visual_c_compiler_version(tools_env): return vc_chosen_compiler_str -def msvc_is_detected() : - # looks for VisualStudio env variable - # or for Visual C++ Build Tools (which is a standalone MSVC) - return os.getenv("VSINSTALLDIR") or os.getenv("VS100COMNTOOLS") or os.getenv("VS110COMNTOOLS") or os.getenv("VS120COMNTOOLS") or os.getenv("VS140COMNTOOLS"); - def precious_program(env, program, sources, **args): program = env.ProgramOriginal(program, sources, **args) diff --git a/modules/openssl/SCsub b/modules/openssl/SCsub index 3cc6f21bd2..2327cf483c 100644 --- a/modules/openssl/SCsub +++ b/modules/openssl/SCsub @@ -671,7 +671,7 @@ if (env["openssl"] != "system"): # builtin # Workaround for compilation error with GCC/Clang when -Werror is too greedy (GH-4517) import os import methods - if not (os.name=="nt" and methods.msvc_is_detected()): # not Windows and not MSVC + if not (os.name=="nt" and os.getenv("VCINSTALLDIR")): # not Windows and not MSVC env_openssl.Append(CFLAGS = ["-Wno-error=implicit-function-declaration"]) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index a5b26930be..7ae0100762 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -1,16 +1,11 @@ # -# tested on | Windows native | Linux cross-compilation -# ----------------------------+-------------------+--------------------------- -# MSVS C++ 2010 Express | WORKS | n/a +# tested on | Windows native | Linux cross-compilation +# ----------------------------+-------------------+--------------------------- # Visual C++ Build Tools 2015 | WORKS | n/a -# Mingw-w64 | WORKS | WORKS -# Mingw-w32 | WORKS | WORKS -# MinGW | WORKS | untested -# -##### -# Notes about MSVS C++ : -# -# - MSVC2010-Express compiles to 32bits only. +# MSVS C++ 2010 Express | WORKS | n/a +# Mingw-w64 | WORKS | WORKS +# Mingw-w32 | WORKS | WORKS +# MinGW | WORKS | untested # ##### # Note about Visual C++ Build Tools : @@ -19,6 +14,11 @@ # http://landinghub.visualstudio.com/visual-cpp-build-tools # ##### +# Notes about MSVS C++ : +# +# - MSVC2010-Express compiles to 32bits only. +# +##### # Notes about Mingw-w64 and Mingw-w32 under Windows : # # - both can be installed using the official installer : @@ -109,7 +109,7 @@ def can_build(): if (os.name=="nt"): #building natively on windows! - if ( methods.msvc_is_detected() ): + if ( os.getenv("VCINSTALLDIR") ): return True else: print("\nMSVC not detected, attempting Mingw.") @@ -204,7 +204,7 @@ def configure(env): env.Append(CPPPATH=['#platform/windows']) env['is_mingw']=False - if (os.name=="nt" and methods.msvc_is_detected() ): + if (os.name=="nt" and os.getenv("VCINSTALLDIR") ): #build using visual studio env['ENV']['TMP'] = os.environ['TMP'] env.Append(CPPPATH=['#platform/windows/include']) |