You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #6501 from SuperUserNameMan/windows_compile_with_standalone_msvc
scons detects standalone MSVC on Windows
This commit is contained in:
@@ -16,7 +16,6 @@ platform_list = [] # list of platforms
|
|||||||
platform_opts = {} # options for each platform
|
platform_opts = {} # options for each platform
|
||||||
platform_flags = {} # flags for each platform
|
platform_flags = {} # flags for each platform
|
||||||
|
|
||||||
|
|
||||||
active_platforms=[]
|
active_platforms=[]
|
||||||
active_platform_ids=[]
|
active_platform_ids=[]
|
||||||
platform_exporters=[]
|
platform_exporters=[]
|
||||||
@@ -60,7 +59,7 @@ platform_arg = ARGUMENTS.get("platform", False)
|
|||||||
if (os.name=="posix"):
|
if (os.name=="posix"):
|
||||||
pass
|
pass
|
||||||
elif (os.name=="nt"):
|
elif (os.name=="nt"):
|
||||||
if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"):
|
if (not methods.msvc_is_detected() or platform_arg=="android"):
|
||||||
custom_tools=['mingw']
|
custom_tools=['mingw']
|
||||||
|
|
||||||
env_base=Environment(tools=custom_tools);
|
env_base=Environment(tools=custom_tools);
|
||||||
|
|||||||
@@ -656,7 +656,8 @@ if "platform" in env and env["platform"] == "winrt":
|
|||||||
|
|
||||||
# Workaround for compilation error with GCC/Clang when -Werror is too greedy (GH-4517)
|
# Workaround for compilation error with GCC/Clang when -Werror is too greedy (GH-4517)
|
||||||
import os
|
import os
|
||||||
if not (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None): # not Windows and not MSVC
|
import methods
|
||||||
|
if not (os.name=="nt" and methods.msvc_is_detected() ): # not Windows and not MSVC
|
||||||
env_drivers.Append(CFLAGS=["-Wno-error=implicit-function-declaration"])
|
env_drivers.Append(CFLAGS=["-Wno-error=implicit-function-declaration"])
|
||||||
|
|
||||||
env_drivers.add_source_files(env.drivers_sources,openssl_sources)
|
env_drivers.add_source_files(env.drivers_sources,openssl_sources)
|
||||||
|
|||||||
@@ -1516,6 +1516,12 @@ def detect_visual_c_compiler_version(tools_env):
|
|||||||
|
|
||||||
return vc_chosen_compiler_str
|
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):
|
def precious_program(env, program, sources, **args):
|
||||||
program = env.ProgramOriginal(program, sources, **args)
|
program = env.ProgramOriginal(program, sources, **args)
|
||||||
env.Precious(program)
|
env.Precious(program)
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
#
|
#
|
||||||
# tested on | Windows native | Linux cross-compilation
|
# tested on | Windows native | Linux cross-compilation
|
||||||
# ------------------------+-------------------+---------------------------
|
# ----------------------------+-------------------+---------------------------
|
||||||
# MSVS C++ 2010 Express | WORKS | n/a
|
# MSVS C++ 2010 Express | WORKS | n/a
|
||||||
|
# Visual C++ Build Tools 2015 | WORKS | n/a
|
||||||
# Mingw-w64 | WORKS | WORKS
|
# Mingw-w64 | WORKS | WORKS
|
||||||
# Mingw-w32 | WORKS | WORKS
|
# Mingw-w32 | WORKS | WORKS
|
||||||
# MinGW | WORKS | untested
|
# MinGW | WORKS | untested
|
||||||
@@ -12,6 +13,12 @@
|
|||||||
# - MSVC2010-Express compiles to 32bits only.
|
# - MSVC2010-Express compiles to 32bits only.
|
||||||
#
|
#
|
||||||
#####
|
#####
|
||||||
|
# Note about Visual C++ Build Tools :
|
||||||
|
#
|
||||||
|
# - Visual C++ Build Tools is the standalone MSVC compiler :
|
||||||
|
# http://landinghub.visualstudio.com/visual-cpp-build-tools
|
||||||
|
#
|
||||||
|
#####
|
||||||
# Notes about Mingw-w64 and Mingw-w32 under Windows :
|
# Notes about Mingw-w64 and Mingw-w32 under Windows :
|
||||||
#
|
#
|
||||||
# - both can be installed using the official installer :
|
# - both can be installed using the official installer :
|
||||||
@@ -102,7 +109,7 @@ def can_build():
|
|||||||
|
|
||||||
if (os.name=="nt"):
|
if (os.name=="nt"):
|
||||||
#building natively on windows!
|
#building natively on windows!
|
||||||
if (os.getenv("VSINSTALLDIR")):
|
if ( methods.msvc_is_detected() ):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print("\nMSVC not detected, attempting Mingw.")
|
print("\nMSVC not detected, attempting Mingw.")
|
||||||
@@ -197,7 +204,7 @@ def configure(env):
|
|||||||
|
|
||||||
env.Append(CPPPATH=['#platform/windows'])
|
env.Append(CPPPATH=['#platform/windows'])
|
||||||
env['is_mingw']=False
|
env['is_mingw']=False
|
||||||
if (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None):
|
if (os.name=="nt" and methods.msvc_is_detected() ):
|
||||||
#build using visual studio
|
#build using visual studio
|
||||||
env['ENV']['TMP'] = os.environ['TMP']
|
env['ENV']['TMP'] = os.environ['TMP']
|
||||||
env.Append(CPPPATH=['#platform/windows/include'])
|
env.Append(CPPPATH=['#platform/windows/include'])
|
||||||
|
|||||||
Reference in New Issue
Block a user