diff --git a/CHANGES.txt b/CHANGES.txt index 38a729f1b8..5f6d667e7b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,6 +15,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From John Doe: - Whatever John Doe did. + From Marcel Admiraal: + - Use scons as the default MSVSSCONS variable. + From Joseph Brill: - Add possible build failure when targeting 32-bit arm using Visual Studio 2022 with Windows SDK version 10.0.26100.0 or later diff --git a/SCons/Tool/msvs.py b/SCons/Tool/msvs.py index b35e267802..12bcc2583b 100644 --- a/SCons/Tool/msvs.py +++ b/SCons/Tool/msvs.py @@ -152,41 +152,6 @@ def msvs_parse_version(s): num, suite = version_re.match(s).groups() return float(num), suite -# This is how we re-invoke SCons from inside MSVS Project files. -# The problem is that we might have been invoked as either scons.bat -# or scons.py. If we were invoked directly as scons.py, then we could -# use sys.argv[0] to find the SCons "executable," but that doesn't work -# if we were invoked as scons.bat, which uses "python -c" to execute -# things and ends up with "-c" as sys.argv[0]. Consequently, we have -# the MSVS Project file invoke SCons the same way that scons.bat does, -# which works regardless of how we were invoked. -def getExecScriptMain(env, xml=None): - if 'SCONS_HOME' not in env: - env['SCONS_HOME'] = os.environ.get('SCONS_HOME') - scons_home = env.get('SCONS_HOME') - if not scons_home and 'SCONS_LIB_DIR' in os.environ: - scons_home = os.environ['SCONS_LIB_DIR'] - if scons_home: - exec_script_main = "from os.path import join; import sys; sys.path = [ r'%s' ] + sys.path; import SCons.Script; SCons.Script.main()" % scons_home - else: - version = SCons.__version__ - exec_script_main = "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-%(version)s'), join(sys.prefix, 'scons-%(version)s'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons') ] + sys.path; import SCons.Script; SCons.Script.main()" % locals() - if xml: - exec_script_main = xmlify(exec_script_main) - return exec_script_main - -# The string for the Python executable we tell the Project file to use -# is either sys.executable or, if an external PYTHON_ROOT environment -# variable exists, $(PYTHON)ROOT\\python.exe (generalized a little to -# pluck the actual executable name from sys.executable). -try: - python_root = os.environ['PYTHON_ROOT'] -except KeyError: - python_executable = sys.executable -else: - python_executable = os.path.join('$$(PYTHON_ROOT)', - os.path.split(sys.executable)[1]) - class Config: pass @@ -2147,7 +2112,7 @@ def generate(env) -> None: # MSVSSCONSFLAGS. This helps support consumers who use wrapper scripts to # invoke scons. if 'MSVSSCONS' not in env: - env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env)) + env['MSVSSCONS'] = 'scons' if 'MSVSSCONSFLAGS' not in env: env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}'