diff options
author | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-12-22 15:50:07 -0500 |
---|---|---|
committer | Gary Oberbrunner <garyo@oberbrunner.com> | 2012-12-22 15:50:07 -0500 |
commit | 79740248ffa7d8d4461cab58ef915f50cd562d90 (patch) | |
tree | e270a76e7eaf3b701d37c440cf183162ac86919e | |
parent | d6ea936cf24a7e59dd3fbd1fa3cbd0600f41bec2 (diff) | |
download | scons-79740248ffa7d8d4461cab58ef915f50cd562d90.tar.gz |
Make VersionedSharedLib and its test not fail on Windows
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 14 | ||||
-rw-r--r-- | test/LINK/VersionedLib.py | 15 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 83c2fb51..89aabb50 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -273,11 +273,14 @@ def VersionShLibLinkNames(version, libname, env): if Verbose: print "VersionShLibLinkNames: linkname ",linkname, ", target ",libname linknames.append(linkname) + # note: no Windows case here (win32 or cygwin); + # MSVC doesn't support this type of versioned shared libs. + # (could probably do something for MinGW though) return linknames def VersionedSharedLibrary(target = None, source= None, env=None): - """Build a shared library. If the environment has SHLIBVERSION -defined make a versioned shared library and create the appropriate + """Build a shared library. If the environment has SHLIBVERSION +defined make a versioned shared library and create the appropriate symlinks for the platform we are on""" Verbose = False try: @@ -339,9 +342,10 @@ symlinks for the platform we are on""" print "VerShLib: made sym link of %s -> %s" % (lastname,linkname) lastname = linkname # finish chain of sym links with link to the actual library - os.symlink(lib_ver,lastname) - if Verbose: - print "VerShLib: made sym link of %s -> %s" % (lib_ver,linkname) + if len(linknames)>0: + os.symlink(lib_ver,lastname) + if Verbose: + print "VerShLib: made sym link of %s -> %s" % (lib_ver,linkname) return result ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None) diff --git a/test/LINK/VersionedLib.py b/test/LINK/VersionedLib.py index 34bef2a5..0d457894 100644 --- a/test/LINK/VersionedLib.py +++ b/test/LINK/VersionedLib.py @@ -46,6 +46,9 @@ env.Default(instnode) """)
test.write('test.c', """\
+#if _WIN32
+__declspec(dllexport)
+#endif
int testlib(int n)
{
return n+1 ;
@@ -95,6 +98,18 @@ elif platform == 'darwin': 'libtest.dylib',
'libtest.2.5.4.dylib',
]
+elif platform == 'win32':
+ # All (?) the files we expect will get created in the current directory
+ files = [
+ 'test.dll',
+ 'test.lib',
+ 'test.obj',
+ ]
+ # All (?) the files we expect will get created in the 'installtest' directory
+ instfiles = [
+ 'test.dll',
+ 'test.lib',
+ ]
else:
# All (?) the files we expect will get created in the current directory
files= [
|