msvc.py (SCons-4.3.0) | : | msvc.py (SCons-4.4.0) | ||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
import SCons.Action | import SCons.Action | |||
import SCons.Builder | import SCons.Builder | |||
import SCons.Errors | import SCons.Errors | |||
import SCons.Platform.win32 | import SCons.Platform.win32 | |||
import SCons.Tool | import SCons.Tool | |||
import SCons.Tool.msvs | import SCons.Tool.msvs | |||
import SCons.Util | import SCons.Util | |||
import SCons.Warnings | import SCons.Warnings | |||
import SCons.Scanner.RC | import SCons.Scanner.RC | |||
from .MSCommon import msvc_exists, msvc_setup_env_once, msvc_version_to_maj_min, msvc_find_vswhere | from .MSCommon import msvc_setup_env_tool, msvc_setup_env_once, msvc_version_to_ maj_min, msvc_find_vswhere | |||
from .MSCommon.common import get_pch_node | from .MSCommon.common import get_pch_node | |||
tool_name = 'msvc' | ||||
CSuffixes = ['.c', '.C'] | CSuffixes = ['.c', '.C'] | |||
CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++'] | CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++'] | |||
def validate_vars(env): | def validate_vars(env): | |||
"""Validate the PCH and PCHSTOP construction variables.""" | """Validate the PCH and PCHSTOP construction variables.""" | |||
if 'PCH' in env and env['PCH']: | if 'PCH' in env and env['PCH']: | |||
if 'PCHSTOP' not in env: | if 'PCHSTOP' not in env: | |||
raise SCons.Errors.UserError("The PCHSTOP construction must be defin ed if PCH is defined.") | raise SCons.Errors.UserError("The PCHSTOP construction must be defin ed if PCH is defined.") | |||
if not SCons.Util.is_String(env['PCHSTOP']): | if not SCons.Util.is_String(env['PCHSTOP']): | |||
raise SCons.Errors.UserError("The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']) | raise SCons.Errors.UserError("The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']) | |||
skipping to change at line 289 | skipping to change at line 291 | |||
env['SHOBJSUFFIX'] = '$OBJSUFFIX' | env['SHOBJSUFFIX'] = '$OBJSUFFIX' | |||
# MSVC probably wont support unistd.h so default | # MSVC probably wont support unistd.h so default | |||
# without it for lex generation | # without it for lex generation | |||
env["LEXUNISTD"] = SCons.Util.CLVar("--nounistd") | env["LEXUNISTD"] = SCons.Util.CLVar("--nounistd") | |||
# Get user specified vswhere location or locate. | # Get user specified vswhere location or locate. | |||
env['VSWHERE'] = env.get('VSWHERE', msvc_find_vswhere()) | env['VSWHERE'] = env.get('VSWHERE', msvc_find_vswhere()) | |||
# Set-up ms tools paths | # Set-up ms tools paths | |||
msvc_setup_env_once(env) | msvc_setup_env_once(env, tool=tool_name) | |||
env['CFILESUFFIX'] = '.c' | env['CFILESUFFIX'] = '.c' | |||
env['CXXFILESUFFIX'] = '.cc' | env['CXXFILESUFFIX'] = '.cc' | |||
msvc_set_PCHPDBFLAGS(env) | msvc_set_PCHPDBFLAGS(env) | |||
# Issue #3350 | # Issue #3350 | |||
# Change tempfile argument joining character from a space to a newline | # Change tempfile argument joining character from a space to a newline | |||
# mslink will fail if any single line is too long, but is fine with many lin es | # mslink will fail if any single line is too long, but is fine with many lin es | |||
# in a tempfile | # in a tempfile | |||
env['TEMPFILEARGJOIN'] = os.linesep | env['TEMPFILEARGJOIN'] = os.linesep | |||
env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEF FLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDB FLAGS' | env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEF FLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDB FLAGS' | |||
env['BUILDERS']['PCH'] = pch_builder | env['BUILDERS']['PCH'] = pch_builder | |||
if 'ENV' not in env: | if 'ENV' not in env: | |||
env['ENV'] = {} | env['ENV'] = {} | |||
if 'SystemRoot' not in env['ENV']: # required for dlls in the winsxs fold ers | if 'SystemRoot' not in env['ENV']: # required for dlls in the winsxs fold ers | |||
env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root() | env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root() | |||
env['CCDEPFLAGS'] = '/showIncludes' | ||||
env["NINJA_DEPFILE_PARSE_FORMAT"] = 'msvc' | ||||
def exists(env): | def exists(env): | |||
return msvc_exists(env) | return msvc_setup_env_tool(env, tool=tool_name) | |||
# Local Variables: | # Local Variables: | |||
# tab-width:4 | # tab-width:4 | |||
# indent-tabs-mode:nil | # indent-tabs-mode:nil | |||
# End: | # End: | |||
# vim: set expandtab tabstop=4 shiftwidth=4: | # vim: set expandtab tabstop=4 shiftwidth=4: | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 8 lines changed or added |