From 4139e0edebe42844054b1120778a54b2b2325a49 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 25 Jun 2019 09:05:26 +0200 Subject: do not use -g unconditionally for building the clang plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The generated files are ~700MiB here, compared to ~85MiB without. Change-Id: I76bafc59ff89fd7eb8ffbc4b9ad79bc63da8f064 Reviewed-on: https://gerrit.libreoffice.org/74678 Reviewed-by: Stephan Bergmann Tested-by: Jenkins Reviewed-by: Luboš Luňák --- compilerplugins/Makefile-clang.mk | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'compilerplugins') diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk index ce3ab90a0ec2..263fd949979f 100644 --- a/compilerplugins/Makefile-clang.mk +++ b/compilerplugins/Makefile-clang.mk @@ -8,8 +8,10 @@ # Make sure variables in this Makefile do not conflict with other variables (e.g. from gbuild). -# Compile flags ('make CLANGCXXFLAGS=-g' if you need to debug the plugin); you -# may occasionally want to override these: +# Set to 1 if you need to debug the plugin). +CLANGDEBUG= + +# Compile flags, you may occasionally want to override these: ifeq ($(OS),WNT) # See LLVM's cmake/modules/AddLLVM.cmake and LLVM build's # tools/llvm-config/BuildVariables.inc: @@ -17,9 +19,19 @@ ifeq ($(OS),WNT) # "LLVM_ATTRIBUTE_ALWAYS_INLINE inline" in various LLVM include files. # * Ignore "warning C4577: 'noexcept' used with no exception handling mode # specified; termination on exception is not guaranteed. Specify /EHsc". -CLANGCXXFLAGS=/nologo /D_HAS_EXCEPTIONS=0 /wd4141 /wd4577 /O2 /Oi /EHs-c- /GR- +CLANGCXXFLAGS=/nologo /D_HAS_EXCEPTIONS=0 /wd4141 /wd4577 /EHs-c- /GR- +ifeq ($(CLANGDEBUG),) +CLANGCXXFLAGS+=/O2 /Oi +else +CLANGCXXFLAGS+=/DEBUG +endif +else # WNT +CLANGCXXFLAGS=-Wall -Wextra -Wundef +ifeq ($(CLANGDEBUG),) +CLANGCXXFLAGS+=-O2 else -CLANGCXXFLAGS=-O2 -Wall -Wextra -Wundef -g +CLANGCXXFLAGS+=-g +endif endif # Whether to make plugins use one shared ASTRecursiveVisitor (plugins run faster). @@ -73,9 +85,11 @@ ifdef LO_CLANG_SHARED_PLUGINS CLANGCXXFLAGS+=-DLO_CLANG_SHARED_PLUGINS endif +ifneq ($(CLANGDEBUG),) ifeq ($(HAVE_GCC_SPLIT_DWARF),TRUE) CLANGCXXFLAGS+=-gsplit-dwarf endif +endif QUIET=$(if $(verbose),,@) -- cgit