summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-10-08 20:14:31 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-10-09 14:56:00 +0200
commit7f791f431c79c6d0a156c4a2726a0dfc5ff40cc1 (patch)
tree9a81d658cb72cdf9a38a4aa55aff522c3400cfd3
parent8e0c45246a3de75d84875500ce3485e1ded4b934 (diff)
filter out the "Creating library" message from link.exe
It cannot be turned off, it doesn't bring any value and it pollutes gbuild output. Change-Id: Ie3684e5fc30c9c5d34bd991e928a8d3f11f0b823 Reviewed-on: https://gerrit.libreoffice.org/80492 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk3
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk4
-rwxr-xr-xsolenv/gbuild/platform/filter-creatingLibrary.awk34
3 files changed, 40 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 3530bdf65ee9..fc046dbb182c 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -225,7 +225,8 @@ $(call gb_Helper_abbreviate_dirs,\
$(sort $(T_LIBS)) user32.lib \
-manifestfile:$(WORKDIR)/LinkTarget/$(2).manifest \
-pdb:$(call gb_LinkTarget__get_pdb_filename,$(WORKDIR)/LinkTarget/$(2))) \
- $(if $(ILIBTARGET),-out:$(1) -implib:$(ILIBTARGET),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \
+ $(if $(ILIBTARGET),-out:$(1) -implib:$(ILIBTARGET),-out:$(1)) \
+ $(call gb_filter_link_output); RC=$$?; rm $${RESPONSEFILE} \
$(if $(filter Library,$(TARGETTYPE)),; if [ ! -f $(ILIBTARGET) ]; then rm -f $(1); exit 42; fi) \
$(if $(filter Library,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest $(SRCDIR)/solenv/gbuild/platform/win_compatibility.manifest -outputresource:$(1)\;2 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest $(ILIBTARGET); fi) \
$(if $(filter Executable,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest $(SRCDIR)/solenv/gbuild/platform/win_compatibility.manifest -outputresource:$(1)\;1 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest; fi) \
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 775481821ca4..df04554b5f30 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -278,6 +278,10 @@ define gb_create_deps
endef
endif
+define gb_filter_link_output
+| LC_ALL=C $(GBUILDDIR)/platform/filter-creatingLibrary.awk; exit $${PIPESTATUS[0]}
+endef
+
gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
# When compiling for CLR, disable "warning C4339: use of undefined type detected
diff --git a/solenv/gbuild/platform/filter-creatingLibrary.awk b/solenv/gbuild/platform/filter-creatingLibrary.awk
new file mode 100755
index 000000000000..943ba64179e3
--- /dev/null
+++ b/solenv/gbuild/platform/filter-creatingLibrary.awk
@@ -0,0 +1,34 @@
+#!/usr/bin/gawk -f
+# -*- tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# Filter out the "Creating library" message printed by link.exe,
+# as there is no way to disable it.
+
+BEGIN {
+ creatinglibrary_prefix = ENVIRON["CREATINGLIBRARY_PREFIX"];
+ if (!creatinglibrary_prefix) {
+ creatinglibrary_prefix = " Creating library "
+ }
+ firstline = 1
+}
+
+{
+ if (firstline && index($0, creatinglibrary_prefix) == 1) {
+ # ignore
+ } else {
+ # because MSVC stupidly prints errors on stdout, it's
+ # necessary to forward everything that isn't matched by the pattern
+ # so users get to see them.
+ print $0 > "/dev/stderr"
+ }
+ firstline = 0
+}
+
+# vim: set noet sw=4 ts=4: