Commits

Gary Oberbrunner committed 1017784

Fix issue 2833 (LINKCOMSTR etc. on Windows).

  • Participants
  • Parent commits e59b816

Comments (0)

Files changed (4)

File src/CHANGES.txt

 
 RELEASE 2.X.X - 
 
+  From smallbub on Bitbucket:
+    - Fix LINKCOMSTR, SHLINKCOMSTR, and LDMODULECOMSTR on Windows (#2833).
+
   From Mortoray:
     - Make -s (silent mode) be silent about entering subdirs (#2976).
     - Fix cloning of builders when cloning environment (#2821).

File src/engine/SCons/Tool/mslink.py

 
 regServerAction = SCons.Action.Action("$REGSVRCOM", "$REGSVRCOMSTR")
 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")}', '$SHLINKCOMSTR')
 compositeShLinkAction = shlibLinkAction + regServerCheck + embedManifestDllCheckAction
-ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}')
+ldmodLinkAction = SCons.Action.Action('${TEMPFILE("$LDMODULE $LDMODULEFLAGS $_LDMODULE_TARGETS $_LIBDIRFLAGS $_LIBFLAGS $_PDB $_LDMODULE_SOURCES")}', '$LDMODULECOMSTR')
 compositeLdmodAction = ldmodLinkAction + regServerCheck + embedManifestDllCheckAction
-exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}')
+exeLinkAction = SCons.Action.Action('${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $_LIBDIRFLAGS $_LIBFLAGS $_PDB $SOURCES.windows")}', '$LINKCOMSTR')
 compositeLinkAction = exeLinkAction + embedManifestExeCheckAction
 
 def generate(env):

File test/LINK/LINKCOMSTR.py

 
 test.must_match('test1.exe', "test1.obj\ntest2.obj\n")
 
+# Now test an actual compile and link.  Since MS Windows
+# resets the link actions, this could fail even if the above
+# test passed.
+test.write('SConstruct', """
+env = Environment(CXXCOMSTR    = 'Compiling $TARGET ...',
+                  LINKCOMSTR   = 'Linking $TARGET ...')
+env.Program('test', 'test.cpp')
+""")
+test.write('test.cpp', """
+int main(int argc, char **argv) {}
+""")
 
+test.run()
+if ("Linking" not in test.stdout()):
+    test.fail_test()
 
 test.pass_test()
 

File test/LINK/SHLINKCOMSTR.py

 test.must_match('test3.dll', "test1.c\ntest2.c\n")
 
 
+# Now test an actual compile and link.  Since MS Windows
+# resets the link actions, this could fail even if the above
+# test passed.
+test.write('SConstruct', """
+env = Environment(CXXCOMSTR    = 'Compiling $TARGET ...',
+                  SHLINKCOMSTR   = 'Shared-Linking $TARGET ...')
+env.SharedLibrary('test', 'test.cpp')
+""")
+test.write('test.cpp', """
+int i;
+""")
+
+test.run()
+if ("Shared-Linking" not in test.stdout()):
+    test.fail_test()
+
 
 
 test.pass_test()