mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Add ENABLE_COVERAGE, for building a +Coverage (gcov) configuration.
- Required some extra makefile tweaks to introduce a new flag var which only goes to compile/link tools but not the relink step, otherwise we get a copy of libgcov in the relinked .o files. - No configure magic for this. llvm-svn: 66945
This commit is contained in:
parent
790659c0d6
commit
5c982814cf
@ -282,6 +282,14 @@ ifndef REQUIRES_RTTI
|
||||
# CXX.Flags += -fno-rtti
|
||||
endif
|
||||
|
||||
ifdef ENABLE_COVERAGE
|
||||
BuildMode := $(BuildMode)+Coverage
|
||||
# These only go to .NoRelink because otherwise we will end up
|
||||
# linking -lgcov into the .o libraries that get built.
|
||||
CXX.Flags.NoRelink += -ftest-coverage -fprofile-arcs
|
||||
C.Flags.NoRelink += -ftest-coverage -fprofile-arcs
|
||||
endif
|
||||
|
||||
# If DISABLE_ASSERTIONS=1 is specified (make command line or configured),
|
||||
# then disable assertions by defining the appropriate preprocessor symbols.
|
||||
ifdef DISABLE_ASSERTIONS
|
||||
@ -551,19 +559,25 @@ CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
|
||||
$(CPP.BaseFlags)
|
||||
|
||||
ifeq ($(BUILD_COMPONENT), 1)
|
||||
Compile.C = $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c
|
||||
Compile.CXX = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c
|
||||
Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -E
|
||||
Link = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
|
||||
$(LD.Flags) $(Strip)
|
||||
Compile.C = $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(C.Flags.NoRelink) \
|
||||
$(CompileCommonOpts) -c
|
||||
Compile.CXX = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \
|
||||
$(CompileCommonOpts) -c
|
||||
Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) \
|
||||
$(CXX.Flags.NoRelink) -E
|
||||
Link = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \
|
||||
$(CompileCommonOpts) $(LD.Flags) $(Strip)
|
||||
Relink = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
|
||||
$(Relink.Flags)
|
||||
else
|
||||
Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c
|
||||
Compile.CXX = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c
|
||||
Preprocess.CXX= $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) -E
|
||||
Link = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
|
||||
$(LD.Flags) $(Strip)
|
||||
Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(C.Flags.NoRelink) \
|
||||
$(CompileCommonOpts) -c
|
||||
Compile.CXX = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \
|
||||
$(CompileCommonOpts) -c
|
||||
Preprocess.CXX= $(CXX) $(CPP.Flags) $(CompileCommonOpts) $(CXX.Flags) \
|
||||
$(CXX.Flags.NoRelink) -E
|
||||
Link = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXX.Flags.NoRelink) \
|
||||
$(CompileCommonOpts) $(LD.Flags) $(Strip)
|
||||
Relink = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) \
|
||||
$(Relink.Flags)
|
||||
endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user