Drop --with-iwyu option

Nowadays the bin/find-unneeded-includes script is a better
solution for this problem

This essentially reverts the commits:
c716b3888e7e8150d1c1053ee6550afb56438b1f
096c7e889f3b9bd42a81fb0216e2a68fb27159fc
40e7eecb7efeeb9af59206d7a9c82ac55adf5279

Change-Id: I404a4b34176efaacf961605559af9de6d6cba10a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133540
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
This commit is contained in:
Gabor Kelemen 2022-04-28 11:14:24 +02:00 committed by Thorsten Behrens
parent 405ab5c330
commit 079659eb7d
5 changed files with 3 additions and 120 deletions

View File

@ -79,17 +79,6 @@ export GMAKE_OPTIONS?=-r$(if $(verbose),,s)$(value $(MAKEFLAGS))
PARALLELISM_OPTION := $(if $(filter-out 0,$(PARALLELISM)),-j $(PARALLELISM),)
IWYU_OPTION := $(if $(IWYU_PATH),-k CC=$(IWYU_PATH) CXX=$(IWYU_PATH),)
# don't want to have a dependency to iwyudummy.generate because it's
# useful to manually edit the generated StaticLibrary_iwyudummy.mk
iwyudummy: bootstrap fetch
$(if $(wildcard $(BUILDDIR)/iwyudummy),,$(error first call "make iwyudummy.generate"))
cd $(BUILDDIR)/iwyudummy && $(MAKE) $(IWYU_OPTION) $(GMAKE_OPTIONS)
iwyudummy.generate:
$(SRCDIR)/bin/gen-iwyu-dummy-lib
#
# Partial Build
#
@ -98,7 +87,7 @@ define gb_Top_GbuildModuleRules
.PHONY: $(1).allbuild $(1).buildall $(1).allcheck $(1).checkall
$(1): bootstrap fetch
cd $(SRCDIR)/$(2) && $$(MAKE) $(IWYU_OPTION) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
cd $(SRCDIR)/$(2) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
$(1).build $(1).check $(foreach target,$(gb_Top_MODULE_CHECK_TARGETS),$(1).$(target)): bootstrap fetch
cd $(SRCDIR)/$(2) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
@ -107,10 +96,10 @@ $(1).clean $(1).showdeliverables:
cd $(SRCDIR)/$(2) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
$(1).allbuild $(1).buildall: bootstrap fetch
$$(MAKE) $(PARALLELISM_OPTION) $(IWYU_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1)
$$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1)
$(1).allcheck $(1).checkall: bootstrap fetch
$$(MAKE) $(PARALLELISM_OPTION) $(IWYU_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)
$$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)
$(1).all:
@echo "'make $(1).all' was renamed to 'make $(1).allcheck' (or use 'make $(1).allbuild' to build without unit tests)"

View File

@ -1,79 +0,0 @@
#!/usr/bin/env bash
#
# 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/.
#
# Create a makefile that builds every non-generated header as a source file.
# This should help to ensure the headers are self-contained and don't
# impose unnecessary requirements (unnecessary includes) on client code.
#
# This script is fully compliant with the UNIX philosophy
# (and if you can't read it you are clearly not worthy)
set -e
iwyu_INCLUDES=$(grep -h -r ":$" "$BUILDDIR"/workdir/Dep/*Object* \
| grep -v 'workdir\|config_host' | grep -v "^/usr" \
| sed -e "s,^${SRCDIR}/,," | sed -e "s/:$//" | sort -u)
iwyu_INCLUDEDIRS=$(echo "$iwyu_INCLUDES" | sed -e "s,/[^/]*$,," | grep -v "^include" | sort -u)
iwyu_EXTERNALS=$(ls "$SRCDIR"/*/*Library*mk "$SRCDIR"/*/*Executable*mk \
| xargs awk -f "$SRCDIR"/bin/gen-iwyu-dummy-lib.awk \
| grep -v '$(\|)\|\\$\|breakpad\|bzip2\|expat_x64\|mDNSResponder\|zlib_x64')
iwyu_DIR="$BUILDDIR"/iwyudummy/
mkdir -p "$iwyu_DIR"
{
echo 'module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))'
echo "include ${SRCDIR}/solenv/gbuild/partial_build.mk"
} > "$iwyu_DIR"Makefile
{
echo '$(eval $(call gb_Module_Module,iwyudummy))'
echo '$(eval $(call gb_Module_add_targets,iwyudummy,StaticLibrary_iwyudummy))'
} > "$iwyu_DIR"Module_iwyudummy.mk
{
# prevent some common configuration errors
echo 'ifneq ($(COMPILER_PLUGINS),)'
echo ' $(call gb_Output_error,--enable-compiler-plugins does not work well with this: bailing out)'
echo 'endif'
echo '$(eval $(call gb_StaticLibrary_StaticLibrary,iwyudummy))'
# clang will "compile" headers to .gch by default
echo '$(eval $(call gb_StaticLibrary_add_cxxflags,iwyudummy,-x c++ -D__cplusplus=201402L -D__STDC_VERSION__=201112L -Wno-unused-macros -Wno-unused-const-variable))'
echo '$(eval $(call gb_StaticLibrary_use_custom_headers,iwyudummy,officecfg/registry))'
echo '$(eval $(call gb_StaticLibrary_use_sdk_api,iwyudummy))'
echo '$(eval $(call gb_StaticLibrary_use_externals,iwyudummy,\'
for ext in ${iwyu_EXTERNALS}; do
echo "${ext} \\";
done
echo '))'
echo '$(eval $(call gb_StaticLibrary_set_include,iwyudummy,\'
echo '$$(INCLUDE) \'
for dir in ${iwyu_INCLUDEDIRS}; do
if echo "$dir" | grep ".*/inc/" &>/dev/null; then
iwyu_INCLUDEDIRS_EXTRA+=" ${dir%/inc/*}/inc"
fi
done
for dir in $(echo ${iwyu_INCLUDEDIRS_EXTRA} | sed -e "s/ /\n/g" | uniq) ${iwyu_INCLUDEDIRS}; do
echo "-I${SRCDIR}/${dir} \\";
done
# it fails to find stddef.h?
echo "-I/usr/lib/clang/$(llvm-config --version)/include \\"
echo "))"
echo '$(eval $(call gb_StaticLibrary__add_iwyu_headers,iwyudummy,\'
for hdr in ${iwyu_INCLUDES}; do
echo "${hdr} \\";
done
echo '))'
} > "$iwyu_DIR"StaticLibrary_iwyudummy.mk

View File

@ -338,7 +338,6 @@ export INSTDIR_FOR_BUILD=@INSTDIR_FOR_BUILD@
export INSTROOT=@INSTROOT@
export INSTROOTBASE=@INSTROOTBASE@
export INSTROOT_FOR_BUILD=@INSTROOT_FOR_BUILD@
export IWYU_PATH=@IWYU_PATH@
export JAVACOMPILER=@JAVACOMPILER@
export JAVADOC=@JAVADOC@
export JAVADOCISGJDOC=@JAVADOCISGJDOC@

View File

@ -2654,12 +2654,6 @@ libo_FUZZ_ARG_WITH(gssapi,
where a good system GSSAPI is available.]),
,)
AC_ARG_WITH(iwyu,
AS_HELP_STRING([--with-iwyu],
[Use given IWYU binary path to check unneeded includes instead of building.
Use only if you are hacking on it.]),
,)
libo_FUZZ_ARG_WITH(lxml,
AS_HELP_STRING([--without-lxml],
[gla11y will use python lxml when available, potentially building a local copy if necessary.
@ -14286,14 +14280,6 @@ else
fi
AC_SUBST(PARALLELISM)
IWYU_PATH="$with_iwyu"
AC_SUBST(IWYU_PATH)
if test ! -z "$IWYU_PATH"; then
if test ! -f "$IWYU_PATH"; then
AC_MSG_ERROR([cannot find include-what-you-use binary specified by --with-iwyu])
fi
fi
#
# Set up ILIB for MSVC build
#

View File

@ -50,18 +50,6 @@ $(call gb_Helper_make_userfriendly_targets,$(1),StaticLibrary)
endef
# this is a crude hack to "build" header files with include-what-you-use
define gb_StaticLibrary__add_iwyu_header
$(call gb_StaticLibrary_get_linktarget_target,$(1)) : $(call gb_GenCxxObject_get_target,$(basename $(2)))
$(call gb_GenCxxObject_get_target,$(basename $(2))) : $(SRCDIR)/$(2)
$(call gb_GenCxxObject_get_target,$(basename $(2))) : WARNINGS_NOT_ERRORS := $(true)
$(call gb_GenCxxObject_get_target,$(basename $(2))) : GEN_CXX_SOURCE := $(SRCDIR)/$(2)
endef
define gb_StaticLibrary__add_iwyu_headers
$(foreach file,$(2),$(call gb_StaticLibrary__add_iwyu_header,$(1),$(file)))
endef
# forward the call to the gb_LinkTarget implementation
# (note: because the function name is in $(1), the other args are shifted by 1)
define gb_StaticLibrary__forward_to_Linktarget