scons: Update the MSVC SA to match latest scons code.
This commit is contained in:
parent
58d376ac42
commit
321aef7da3
|
@ -7,7 +7,7 @@ Based on SCons.Tool.mslib, without the MSVC detection.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
|
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
# a copy of this software and associated documentation files (the
|
# a copy of this software and associated documentation files (the
|
||||||
|
@ -130,4 +130,8 @@ def generate(env):
|
||||||
def exists(env):
|
def exists(env):
|
||||||
return env.Detect('lib') or env.Detect('link')
|
return env.Detect('lib') or env.Detect('link')
|
||||||
|
|
||||||
# vim:set ts=4 sw=4 et:
|
# Local Variables:
|
||||||
|
# tab-width:4
|
||||||
|
# indent-tabs-mode:nil
|
||||||
|
# End:
|
||||||
|
# vim: set expandtab tabstop=4 shiftwidth=4:
|
||||||
|
|
|
@ -7,7 +7,7 @@ Based on SCons.Tool.mslink, without the MSVS detection.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
|
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
# a copy of this software and associated documentation files (the
|
# a copy of this software and associated documentation files (the
|
||||||
|
@ -45,9 +45,9 @@ def pdbGenerator(env, target, source, for_signature):
|
||||||
except (AttributeError, IndexError):
|
except (AttributeError, IndexError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def windowsShlinkTargets(target, source, env, for_signature):
|
def _dllTargets(target, source, env, for_signature, paramtp):
|
||||||
listCmd = []
|
listCmd = []
|
||||||
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
|
dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)
|
||||||
if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
|
if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
|
||||||
|
|
||||||
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
|
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
|
||||||
|
@ -55,12 +55,15 @@ def windowsShlinkTargets(target, source, env, for_signature):
|
||||||
|
|
||||||
return listCmd
|
return listCmd
|
||||||
|
|
||||||
def windowsShlinkSources(target, source, env, for_signature):
|
def _dllSources(target, source, env, for_signature, paramtp):
|
||||||
listCmd = []
|
listCmd = []
|
||||||
|
|
||||||
deffile = env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX")
|
deffile = env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX")
|
||||||
for src in source:
|
for src in source:
|
||||||
if src == deffile:
|
# Check explicitly for a non-None deffile so that the __cmp__
|
||||||
|
# method of the base SCons.Util.Proxy class used for some Node
|
||||||
|
# proxies doesn't try to use a non-existent __dict__ attribute.
|
||||||
|
if deffile and src == deffile:
|
||||||
# Treat this source as a .def file.
|
# Treat this source as a .def file.
|
||||||
listCmd.append("/def:%s" % src.get_string(for_signature))
|
listCmd.append("/def:%s" % src.get_string(for_signature))
|
||||||
else:
|
else:
|
||||||
|
@ -68,17 +71,32 @@ def windowsShlinkSources(target, source, env, for_signature):
|
||||||
listCmd.append(src)
|
listCmd.append(src)
|
||||||
return listCmd
|
return listCmd
|
||||||
|
|
||||||
def windowsLibEmitter(target, source, env):
|
def windowsShlinkTargets(target, source, env, for_signature):
|
||||||
|
return _dllTargets(target, source, env, for_signature, 'SHLIB')
|
||||||
|
|
||||||
|
def windowsShlinkSources(target, source, env, for_signature):
|
||||||
|
return _dllSources(target, source, env, for_signature, 'SHLIB')
|
||||||
|
|
||||||
|
def _windowsLdmodTargets(target, source, env, for_signature):
|
||||||
|
"""Get targets for loadable modules."""
|
||||||
|
return _dllTargets(target, source, env, for_signature, 'LDMODULE')
|
||||||
|
|
||||||
|
def _windowsLdmodSources(target, source, env, for_signature):
|
||||||
|
"""Get sources for loadable modules."""
|
||||||
|
return _dllSources(target, source, env, for_signature, 'LDMODULE')
|
||||||
|
|
||||||
|
def _dllEmitter(target, source, env, paramtp):
|
||||||
|
"""Common implementation of dll emitter."""
|
||||||
SCons.Tool.msvc.validate_vars(env)
|
SCons.Tool.msvc.validate_vars(env)
|
||||||
|
|
||||||
extratargets = []
|
extratargets = []
|
||||||
extrasources = []
|
extrasources = []
|
||||||
|
|
||||||
dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
|
dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)
|
||||||
no_import_lib = env.get('no_import_lib', 0)
|
no_import_lib = env.get('no_import_lib', 0)
|
||||||
|
|
||||||
if not dll:
|
if not dll:
|
||||||
raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
|
raise SCons.Errors.UserError, 'A shared library should have exactly one target with the suffix: %s' % env.subst('$%sSUFFIX' % paramtp)
|
||||||
|
|
||||||
insert_def = env.subst("$WINDOWS_INSERT_DEF")
|
insert_def = env.subst("$WINDOWS_INSERT_DEF")
|
||||||
if not insert_def in ['', '0', 0] and \
|
if not insert_def in ['', '0', 0] and \
|
||||||
|
@ -87,7 +105,7 @@ def windowsLibEmitter(target, source, env):
|
||||||
# append a def file to the list of sources
|
# append a def file to the list of sources
|
||||||
extrasources.append(
|
extrasources.append(
|
||||||
env.ReplaceIxes(dll,
|
env.ReplaceIxes(dll,
|
||||||
"SHLIBPREFIX", "SHLIBSUFFIX",
|
'%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,
|
||||||
"WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"))
|
"WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"))
|
||||||
|
|
||||||
if env.has_key('PDB') and env['PDB']:
|
if env.has_key('PDB') and env['PDB']:
|
||||||
|
@ -100,16 +118,27 @@ def windowsLibEmitter(target, source, env):
|
||||||
# Append an import library to the list of targets.
|
# Append an import library to the list of targets.
|
||||||
extratargets.append(
|
extratargets.append(
|
||||||
env.ReplaceIxes(dll,
|
env.ReplaceIxes(dll,
|
||||||
"SHLIBPREFIX", "SHLIBSUFFIX",
|
'%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,
|
||||||
"LIBPREFIX", "LIBSUFFIX"))
|
"LIBPREFIX", "LIBSUFFIX"))
|
||||||
# and .exp file is created if there are exports from a DLL
|
# and .exp file is created if there are exports from a DLL
|
||||||
extratargets.append(
|
extratargets.append(
|
||||||
env.ReplaceIxes(dll,
|
env.ReplaceIxes(dll,
|
||||||
"SHLIBPREFIX", "SHLIBSUFFIX",
|
'%sPREFIX' % paramtp, '%sSUFFIX' % paramtp,
|
||||||
"WINDOWSEXPPREFIX", "WINDOWSEXPSUFFIX"))
|
"WINDOWSEXPPREFIX", "WINDOWSEXPSUFFIX"))
|
||||||
|
|
||||||
return (target+extratargets, source+extrasources)
|
return (target+extratargets, source+extrasources)
|
||||||
|
|
||||||
|
def windowsLibEmitter(target, source, env):
|
||||||
|
return _dllEmitter(target, source, env, 'SHLIB')
|
||||||
|
|
||||||
|
def ldmodEmitter(target, source, env):
|
||||||
|
"""Emitter for loadable modules.
|
||||||
|
|
||||||
|
Loadable modules are identical to shared libraries on Windows, but building
|
||||||
|
them is subject to different parameters (LDMODULE*).
|
||||||
|
"""
|
||||||
|
return _dllEmitter(target, source, env, 'LDMODULE')
|
||||||
|
|
||||||
def prog_emitter(target, source, env):
|
def prog_emitter(target, source, env):
|
||||||
SCons.Tool.msvc.validate_vars(env)
|
SCons.Tool.msvc.validate_vars(env)
|
||||||
|
|
||||||
|
@ -138,8 +167,10 @@ def RegServerFunc(target, source, env):
|
||||||
|
|
||||||
regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
|
regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
|
||||||
regServerCheck = SCons.Action.Action(RegServerFunc, None)
|
regServerCheck = SCons.Action.Action(RegServerFunc, None)
|
||||||
shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
|
shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
|
||||||
compositeLinkAction = shlibLinkAction + regServerCheck
|
compositeShLinkAction = shlibLinkAction + regServerCheck
|
||||||
|
ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}')
|
||||||
|
compositeLdmodAction = ldmodLinkAction + regServerCheck
|
||||||
|
|
||||||
def generate(env):
|
def generate(env):
|
||||||
"""Add Builders and construction variables for ar to an Environment."""
|
"""Add Builders and construction variables for ar to an Environment."""
|
||||||
|
@ -150,12 +181,12 @@ def generate(env):
|
||||||
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
|
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
|
||||||
env['_SHLINK_TARGETS'] = windowsShlinkTargets
|
env['_SHLINK_TARGETS'] = windowsShlinkTargets
|
||||||
env['_SHLINK_SOURCES'] = windowsShlinkSources
|
env['_SHLINK_SOURCES'] = windowsShlinkSources
|
||||||
env['SHLINKCOM'] = compositeLinkAction
|
env['SHLINKCOM'] = compositeShLinkAction
|
||||||
env.Append(SHLIBEMITTER = [windowsLibEmitter])
|
env.Append(SHLIBEMITTER = [windowsLibEmitter])
|
||||||
env['LINK'] = 'link'
|
env['LINK'] = 'link'
|
||||||
env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')
|
env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')
|
||||||
env['_PDB'] = pdbGenerator
|
env['_PDB'] = pdbGenerator
|
||||||
env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES.windows")}'
|
env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}'
|
||||||
env.Append(PROGEMITTER = [prog_emitter])
|
env.Append(PROGEMITTER = [prog_emitter])
|
||||||
env['LIBDIRPREFIX']='/LIBPATH:'
|
env['LIBDIRPREFIX']='/LIBPATH:'
|
||||||
env['LIBDIRSUFFIX']=''
|
env['LIBDIRSUFFIX']=''
|
||||||
|
@ -184,19 +215,19 @@ def generate(env):
|
||||||
env['REGSVRFLAGS'] = '/s '
|
env['REGSVRFLAGS'] = '/s '
|
||||||
env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'
|
env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'
|
||||||
|
|
||||||
# For most platforms, a loadable module is the same as a shared
|
# Loadable modules are on Windows the same as shared libraries, but they
|
||||||
# library. Platforms which are different can override these, but
|
# are subject to different build parameters (LDMODULE* variables).
|
||||||
# setting them the same means that LoadableModule works everywhere.
|
# Therefore LDMODULE* variables correspond as much as possible to
|
||||||
|
# SHLINK*/SHLIB* ones.
|
||||||
SCons.Tool.createLoadableModuleBuilder(env)
|
SCons.Tool.createLoadableModuleBuilder(env)
|
||||||
env['LDMODULE'] = '$SHLINK'
|
env['LDMODULE'] = '$SHLINK'
|
||||||
env['LDMODULEPREFIX'] = '$SHLIBPREFIX'
|
env['LDMODULEPREFIX'] = '$SHLIBPREFIX'
|
||||||
env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'
|
env['LDMODULESUFFIX'] = '$SHLIBSUFFIX'
|
||||||
env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
|
env['LDMODULEFLAGS'] = '$SHLINKFLAGS'
|
||||||
# We can't use '$SHLINKCOM' here because that will stringify the
|
env['_LDMODULE_TARGETS'] = _windowsLdmodTargets
|
||||||
# action list on expansion, and will then try to execute expanded
|
env['_LDMODULE_SOURCES'] = _windowsLdmodSources
|
||||||
# strings, with the upshot that it would try to execute RegServerFunc
|
env['LDMODULEEMITTER'] = [ldmodEmitter]
|
||||||
# as a command.
|
env['LDMODULECOM'] = compositeLdmodAction
|
||||||
env['LDMODULECOM'] = compositeLinkAction
|
|
||||||
|
|
||||||
def exists(env):
|
def exists(env):
|
||||||
platform = env.get('PLATFORM', '')
|
platform = env.get('PLATFORM', '')
|
||||||
|
@ -208,4 +239,8 @@ def exists(env):
|
||||||
return env.Detect('link')
|
return env.Detect('link')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# vim:set ts=4 sw=4 et:
|
# Local Variables:
|
||||||
|
# tab-width:4
|
||||||
|
# indent-tabs-mode:nil
|
||||||
|
# End:
|
||||||
|
# vim: set expandtab tabstop=4 shiftwidth=4:
|
||||||
|
|
103
scons/msvc_sa.py
103
scons/msvc_sa.py
|
@ -7,7 +7,7 @@ Based on SCons.Tool.msvc, without the MSVS detection.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
|
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
# a copy of this software and associated documentation files (the
|
# a copy of this software and associated documentation files (the
|
||||||
|
@ -40,6 +40,7 @@ import SCons.Platform.win32
|
||||||
import SCons.Tool
|
import SCons.Tool
|
||||||
import SCons.Util
|
import SCons.Util
|
||||||
import SCons.Warnings
|
import SCons.Warnings
|
||||||
|
import SCons.Scanner.RC
|
||||||
|
|
||||||
CSuffixes = ['.c', '.C']
|
CSuffixes = ['.c', '.C']
|
||||||
CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
|
CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
|
||||||
|
@ -97,47 +98,114 @@ pch_action = SCons.Action.Action('$PCHCOM', '$PCHCOMSTR')
|
||||||
pch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',
|
pch_builder = SCons.Builder.Builder(action=pch_action, suffix='.pch',
|
||||||
emitter=pch_emitter,
|
emitter=pch_emitter,
|
||||||
source_scanner=SCons.Tool.SourceFileScanner)
|
source_scanner=SCons.Tool.SourceFileScanner)
|
||||||
|
|
||||||
|
|
||||||
|
# Logic to build .rc files into .res files (resource files)
|
||||||
|
res_scanner = SCons.Scanner.RC.RCScan()
|
||||||
res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
|
res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
|
||||||
res_builder = SCons.Builder.Builder(action=res_action,
|
res_builder = SCons.Builder.Builder(action=res_action,
|
||||||
src_suffix='.rc',
|
src_suffix='.rc',
|
||||||
suffix='.res',
|
suffix='.res',
|
||||||
src_builder=[],
|
src_builder=[],
|
||||||
source_scanner=SCons.Tool.SourceFileScanner)
|
source_scanner=res_scanner)
|
||||||
SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
|
|
||||||
|
def msvc_batch_key(action, env, target, source):
|
||||||
|
"""
|
||||||
|
Returns a key to identify unique batches of sources for compilation.
|
||||||
|
|
||||||
|
If batching is enabled (via the $MSVC_BATCH setting), then all
|
||||||
|
target+source pairs that use the same action, defined by the same
|
||||||
|
environment, and have the same target and source directories, will
|
||||||
|
be batched.
|
||||||
|
|
||||||
|
Returning None specifies that the specified target+source should not
|
||||||
|
be batched with other compilations.
|
||||||
|
"""
|
||||||
|
b = env.subst('$MSVC_BATCH')
|
||||||
|
if b in (None, '', '0'):
|
||||||
|
# We're not using batching; return no key.
|
||||||
|
return None
|
||||||
|
t = target[0]
|
||||||
|
s = source[0]
|
||||||
|
if os.path.splitext(t.name)[0] != os.path.splitext(s.name)[0]:
|
||||||
|
# The base names are different, so this *must* be compiled
|
||||||
|
# separately; return no key.
|
||||||
|
return None
|
||||||
|
return (id(action), id(env), t.dir, s.dir)
|
||||||
|
|
||||||
|
def msvc_output_flag(target, source, env, for_signature):
|
||||||
|
"""
|
||||||
|
Returns the correct /Fo flag for batching.
|
||||||
|
|
||||||
|
If batching is disabled or there's only one source file, then we
|
||||||
|
return an /Fo string that specifies the target explicitly. Otherwise,
|
||||||
|
we return an /Fo string that just specifies the first target's
|
||||||
|
directory (where the Visual C/C++ compiler will put the .obj files).
|
||||||
|
"""
|
||||||
|
b = env.subst('$MSVC_BATCH')
|
||||||
|
if b in (None, '', '0') or len(source) == 1:
|
||||||
|
return '/Fo$TARGET'
|
||||||
|
else:
|
||||||
|
# The Visual C/C++ compiler requires a \ at the end of the /Fo
|
||||||
|
# option to indicate an output directory. We use os.sep here so
|
||||||
|
# that the test(s) for this can be run on non-Windows systems
|
||||||
|
# without having a hard-coded backslash mess up command-line
|
||||||
|
# argument parsing.
|
||||||
|
return '/Fo${TARGET.dir}' + os.sep
|
||||||
|
|
||||||
|
CAction = SCons.Action.Action("$CCCOM", "$CCCOMSTR",
|
||||||
|
batch_key=msvc_batch_key,
|
||||||
|
targets='$CHANGED_TARGETS')
|
||||||
|
ShCAction = SCons.Action.Action("$SHCCCOM", "$SHCCCOMSTR",
|
||||||
|
batch_key=msvc_batch_key,
|
||||||
|
targets='$CHANGED_TARGETS')
|
||||||
|
CXXAction = SCons.Action.Action("$CXXCOM", "$CXXCOMSTR",
|
||||||
|
batch_key=msvc_batch_key,
|
||||||
|
targets='$CHANGED_TARGETS')
|
||||||
|
ShCXXAction = SCons.Action.Action("$SHCXXCOM", "$SHCXXCOMSTR",
|
||||||
|
batch_key=msvc_batch_key,
|
||||||
|
targets='$CHANGED_TARGETS')
|
||||||
|
|
||||||
def generate(env):
|
def generate(env):
|
||||||
"""Add Builders and construction variables for MSVC++ to an Environment."""
|
"""Add Builders and construction variables for MSVC++ to an Environment."""
|
||||||
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
|
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
|
||||||
|
|
||||||
|
# TODO(batch): shouldn't reach in to cmdgen this way; necessary
|
||||||
|
# for now to bypass the checks in Builder.DictCmdGenerator.__call__()
|
||||||
|
# and allow .cc and .cpp to be compiled in the same command line.
|
||||||
|
static_obj.cmdgen.source_ext_match = False
|
||||||
|
shared_obj.cmdgen.source_ext_match = False
|
||||||
|
|
||||||
for suffix in CSuffixes:
|
for suffix in CSuffixes:
|
||||||
static_obj.add_action(suffix, SCons.Defaults.CAction)
|
static_obj.add_action(suffix, CAction)
|
||||||
shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
|
shared_obj.add_action(suffix, ShCAction)
|
||||||
static_obj.add_emitter(suffix, static_object_emitter)
|
static_obj.add_emitter(suffix, static_object_emitter)
|
||||||
shared_obj.add_emitter(suffix, shared_object_emitter)
|
shared_obj.add_emitter(suffix, shared_object_emitter)
|
||||||
|
|
||||||
for suffix in CXXSuffixes:
|
for suffix in CXXSuffixes:
|
||||||
static_obj.add_action(suffix, SCons.Defaults.CXXAction)
|
static_obj.add_action(suffix, CXXAction)
|
||||||
shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
|
shared_obj.add_action(suffix, ShCXXAction)
|
||||||
static_obj.add_emitter(suffix, static_object_emitter)
|
static_obj.add_emitter(suffix, static_object_emitter)
|
||||||
shared_obj.add_emitter(suffix, shared_object_emitter)
|
shared_obj.add_emitter(suffix, shared_object_emitter)
|
||||||
|
|
||||||
env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}'])
|
env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Z7") or ""}'])
|
||||||
env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
|
env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
|
||||||
env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS'
|
env['_MSVC_OUTPUT_FLAG'] = msvc_output_flag
|
||||||
|
env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS'
|
||||||
env['CC'] = 'cl'
|
env['CC'] = 'cl'
|
||||||
env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
|
env['CCFLAGS'] = SCons.Util.CLVar('/nologo')
|
||||||
env['CFLAGS'] = SCons.Util.CLVar('')
|
env['CFLAGS'] = SCons.Util.CLVar('')
|
||||||
env['CCCOM'] = '$CC $CFLAGS $CCFLAGS $CCCOMFLAGS'
|
env['CCCOM'] = '$CC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CFLAGS $CCFLAGS $_CCCOMCOM'
|
||||||
env['SHCC'] = '$CC'
|
env['SHCC'] = '$CC'
|
||||||
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
|
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
|
||||||
env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
|
env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
|
||||||
env['SHCCCOM'] = '$SHCC $SHCFLAGS $SHCCFLAGS $CCCOMFLAGS'
|
env['SHCCCOM'] = '$SHCC $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCFLAGS $SHCCFLAGS $_CCCOMCOM'
|
||||||
env['CXX'] = '$CC'
|
env['CXX'] = '$CC'
|
||||||
env['CXXFLAGS'] = SCons.Util.CLVar('$CCFLAGS $( /TP $)')
|
env['CXXFLAGS'] = SCons.Util.CLVar('$( /TP $)')
|
||||||
env['CXXCOM'] = '$CXX $CXXFLAGS $CCCOMFLAGS'
|
env['CXXCOM'] = '$CXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $CXXFLAGS $CCFLAGS $_CCCOMCOM'
|
||||||
env['SHCXX'] = '$CXX'
|
env['SHCXX'] = '$CXX'
|
||||||
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
|
env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
|
||||||
env['SHCXXCOM'] = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'
|
env['SHCXXCOM'] = '$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM'
|
||||||
env['CPPDEFPREFIX'] = '/D'
|
env['CPPDEFPREFIX'] = '/D'
|
||||||
env['CPPDEFSUFFIX'] = ''
|
env['CPPDEFSUFFIX'] = ''
|
||||||
env['INCPREFIX'] = '/I'
|
env['INCPREFIX'] = '/I'
|
||||||
|
@ -148,6 +216,7 @@ def generate(env):
|
||||||
|
|
||||||
env['RC'] = 'rc'
|
env['RC'] = 'rc'
|
||||||
env['RCFLAGS'] = SCons.Util.CLVar('')
|
env['RCFLAGS'] = SCons.Util.CLVar('')
|
||||||
|
env['RCSUFFIXES']=['.rc','.rc2']
|
||||||
env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
|
env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
|
||||||
env['BUILDERS']['RES'] = res_builder
|
env['BUILDERS']['RES'] = res_builder
|
||||||
env['OBJPREFIX'] = ''
|
env['OBJPREFIX'] = ''
|
||||||
|
@ -159,7 +228,7 @@ def generate(env):
|
||||||
env['CXXFILESUFFIX'] = '.cc'
|
env['CXXFILESUFFIX'] = '.cc'
|
||||||
|
|
||||||
env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
|
env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
|
||||||
env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
|
env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
|
||||||
env['BUILDERS']['PCH'] = pch_builder
|
env['BUILDERS']['PCH'] = pch_builder
|
||||||
|
|
||||||
if not env.has_key('ENV'):
|
if not env.has_key('ENV'):
|
||||||
|
@ -170,4 +239,8 @@ def generate(env):
|
||||||
def exists(env):
|
def exists(env):
|
||||||
return env.Detect('cl')
|
return env.Detect('cl')
|
||||||
|
|
||||||
# vim:set ts=4 sw=4 et:
|
# Local Variables:
|
||||||
|
# tab-width:4
|
||||||
|
# indent-tabs-mode:nil
|
||||||
|
# End:
|
||||||
|
# vim: set expandtab tabstop=4 shiftwidth=4:
|
||||||
|
|
Loading…
Reference in New Issue