diff options
author | Pawel Tomulik <ptomulik@meil.pw.edu.pl> | 2015-09-04 22:50:43 (GMT) |
---|---|---|
committer | Pawel Tomulik <ptomulik@meil.pw.edu.pl> | 2015-09-04 22:50:43 (GMT) |
commit | cf4df802f7c81e2eb07628850165ad1e2269334a (patch) | |
tree | 533f96bf818e9c4b847c2fff265b8aaff358d576 /src/engine/SCons/Tool/__init__.py | |
parent | 13c193a7dabeecc0381a6ef770e72de216eb3f5c (diff) | |
download | SCons-cf4df802f7c81e2eb07628850165ad1e2269334a.zip SCons-cf4df802f7c81e2eb07628850165ad1e2269334a.tar.gz SCons-cf4df802f7c81e2eb07628850165ad1e2269334a.tar.bz2 |
add action string function for LibSymlinksAction
Diffstat (limited to 'src/engine/SCons/Tool/__init__.py')
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index df917ed..d1f41ec 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -466,7 +466,7 @@ class _LibNameGenerator(_LibInfoGeneratorBase): super(_LibNameGenerator, self).__init__(libtype, 'Name') def __call__(self, env, libnode, **kw): - """Returns library name with version suffixes stripped""" + """Returns "demangled" library name""" Verbose = False if Verbose: @@ -536,9 +536,7 @@ def StringizeLibSymlinks(symlinks): if SCons.Util.is_List(symlinks): try: return [ (k.get_path(), v.get_path()) for k,v in symlinks ] - except TypeError: - return symlinks - except ValueError: + except (TypeError, ValueError): return symlinks else: return symlinks @@ -589,7 +587,24 @@ def LibSymlinksActionFunction(target, source, env): CreateLibSymlinks(env, symlinks) return 0 -LibSymlinksAction = SCons.Action.Action(LibSymlinksActionFunction, None) +def LibSymlinksStrFun(target, source, env,*args): + cmd = None + for tgt in target: + symlinks = getattr(getattr(tgt,'attributes', None), 'shliblinks', None) + if symlinks: + if cmd is None: cmd = "" + if cmd: cmd += "\n" + cmd += "Create symlinks for: %r" % tgt.get_path() + try: + linkstr = ', '.join([ "%r->%r" %(k,v) for k,v in StringizeLibSymlinks(symlinks)]) + except (KeyError, ValueError): + pass + else: + cmd += ": %s" % linkstr + return cmd + + +LibSymlinksAction = SCons.Action.Action(LibSymlinksActionFunction, LibSymlinksStrFun) def createSharedLibBuilder(env): """This is a utility function that creates the SharedLibrary |