Mesa (master): meson: do not disable incremental linking for debug-builds

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 20 12:39:40 UTC 2020


Module: Mesa
Branch: master
Commit: d6b7439619c55d317bfe05094a9f503d832c9eb7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d6b7439619c55d317bfe05094a9f503d832c9eb7

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Apr 15 20:35:46 2020 +0200

meson: do not disable incremental linking for debug-builds

Meson specifies /EDITANDCONTINUE for MSVC projects when using the debug
build-type. This collides with our across-the-board disabling of
incremental linking.

It's clear that we don't want to do incremental linking for
release-builds; it increase the code-size, and adds some needless jumps
to be able to patch in new code. But for debug-builds this seems like a
good thing; we can now debug and on-the-fly recompile changes if we want
to.

This flag seems to have been simply forwarded from the SCons build
system, where it makes a bit more sense; SCons doesn't really integrate
with visual studio, so you can't properly debug with it. But Meson does,
so let's keep some bells-and-whistles here.

So let's avoid disabling incremental linking for debug-builds. For other
builds we still want to do this, because Meson only disables it
automatically for minsize-builds.

This avoids a boat-loads of warnings on the form:

warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification

Acked-by: Jose Fonseca <jfonseca at vmware.com>
Acked-by: Dylan Baker <dylan at pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4572>

---

 meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 9184b69ea8a..3623d3dc0fd 100644
--- a/meson.build
+++ b/meson.build
@@ -1030,11 +1030,16 @@ if host_machine.system() == 'windows'
   if cc.get_id() == 'msvc'
     add_project_link_arguments(
       '/fixed:no',
-      '/incremental:no',
       '/dynamicbase',
       '/nxcompat',
       language : ['c', 'cpp'],
     )
+    if get_option('buildtype') != 'debug'
+      add_project_link_arguments(
+        '/incremental:no',
+        language : ['c', 'cpp'],
+      )
+    endif
   else
     add_project_link_arguments(
       '-Wl,--nxcompat',



More information about the mesa-commit mailing list