[Scons-users] Honoring the 'SDK shell' settings when using msvc and mssdk tools?

Dirk Bächle tshortik at gmx.de
Tue Apr 2 19:37:15 EDT 2013


Hi Andrew,

On 03.04.2013 00:01, Andrew C. Morrow wrote:

>

> Sometimes, the msvc and mssdk tools don't do the right thing for

> various reasons. Sometimes, this is because SCons isn't yet aware of

> the SDK (SCons 2.3.0 doesn't know about Windows SDK 7.1 or 8, for

> instance).

>

> ...

> Is there some way to tell the MSCommon tools to skip the whole

> 'search' aspect and to simply propagate the variables that it would

> normally set, but with values taken from the invoking shell environment?

>


the sdk Tool tries to find the most recent version first, so if it would
be aware of the v7.1 or v8.0 it would skip the rest.


> Alternatively, is there a way to inject knowledge about new SDKs into

> the MSCommon framework without requiring the SCons sources to be

> edited? The lack of support for the Windows 7.1 SDK in SCons 2.3.0 is

> sort of surprising and frustrating, but if there were a mechanism to

> inject the required definition then this would go a long way.

>


In SCons you can always use the power of Python. So you could try
something like (untested, and an ugly hack):

env = Environment(tools=[])
import SCons.Tool.MSCommon.sdk as msd
# Set new version list
msd.SDK71VCSetupScripts = { 'x86' : r'bin\vcvars32.bat',
'amd64' : r'bin\vcvars64.bat',
'x86_amd64': r'bin\vcvarsx86_amd64.bat',
'x86_ia64' : r'bin\vcvarsx86_ia64.bat',
'ia64' : r'bin\vcvarsia64.bat'}
msd.SupportedSDKList = [
msd.WindowsSDK('7.1',
sanity_check_file=r'bin\SetEnv.Cmd',
include_subdir='include',
lib_subdir={
'x86' : ['lib'],
'x86_64' : [r'lib\x64'],
'ia64' : [r'lib\ia64'],
},
vc_setup_scripts = SDK71VCSetupScripts,
)]
env.Tool('mssdk')


, but forking the current source, patching it and creating a pull
request is the much better approach. ;)

Best regards,

Dirk



More information about the Scons-users mailing list