1. Eric Anderson
  2. SCons-custom-sig


Joshua Hughes  committed 764064e

Fix issue 2856.

This change fixes issue 2856 by making scons consider the .def file only if
it's explicitly given or insertion is explicitly requested.

Comments (0)

Files changed (1)

File src/engine/SCons/Tool/mingw.py Modified

View file
  • Ignore whitespace
  • Hide word diff
     # Append a def file target if there isn't already a def file target
-    # or a def file source. There is no option to disable def file
-    # target emitting, because I can't figure out why someone would ever
-    # want to turn it off.
+    # or a def file source or the user has explicitly asked for the target
+    # to be emitted.
     def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
     def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
-    if not def_source and not def_target:
+    skip_def_insert = env.subst("$WINDOWS_INSERT_DEF") in ['', '0', 0]
+    if not def_source and not def_target and not skip_def_insert:
         # Create list of target libraries and def files as strings
                                       'SHLIBPREFIX', 'SHLIBSUFFIX',