Skip to content

Commit

Permalink
configure.ac, cmake: Support coverage build with clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmokHuginnsson committed Sep 19, 2018
1 parent ca1e164 commit 992706a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ include $(DIR_ROOT)/_aux/mk/40_commit-id.mk
include $(DIR_ROOT)/_aux/mk/50_wrapper.mk
include $(DIR_ROOT)/_aux/mk/60_flags.mk
EXTRA_COMPILER_DEBUG_FLAGS=@EXTRA_COMPILER_DEBUG_FLAGS@
EXTRA_COMPILER_COVERAGE_FLAGS=@EXTRA_COMPILER_COVERAGE_FLAGS@
EXTRA_COMPILER_OPTIMIZATION_FLAGS=@EXTRA_COMPILER_OPTIMIZATION_FLAGS@
EXTRA_INCLUDE_PATHS=@EXTRA_INCLUDE_PATHS@
EXTRA_LIBRARY_PATHS=@EXTRA_LIBRARY_PATHS@
Expand Down
2 changes: 2 additions & 0 deletions _aux/aclib.m4
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ AC_DEFUN_ONCE([YAAL_DETECT_COMMON_FLAGS], [
else
YAAL_DETECT_FLAGS(EXTRA_LXXFLAGS, [-Wl,--no-keep-memory], [C++])
fi
YAAL_DETECT_FLAGS(EXTRA_COMPILER_COVERAGE_FLAGS, [-fno-default-inline], [C++])
YAAL_DETECT_FLAGS(EXTRA_COMPILER_COVERAGE_FLAGS, [-fno-inline-small-functions], [C++])
if test ["x${START_GROUP}"] != ["x"] ; then
END_GROUP=["-Wl,--end-group"]
fi
Expand Down
1 change: 1 addition & 0 deletions _aux/client-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ AC_SUBST([EXTRA_LIBRARY_PATHS], [${EXTRA_LIBRARY_PATHS}])
AC_SUBST([EXTRA_CXXFLAGS],[${EXTRA_CXXFLAGS}])
AC_SUBST([EXTRA_LXXFLAGS],[${EXTRA_LXXFLAGS}])
AC_SUBST([EXTRA_COMPILER_DEBUG_FLAGS],[${EXTRA_COMPILER_DEBUG_FLAGS}])
AC_SUBST([EXTRA_COMPILER_COVERAGE_FLAGS],[${EXTRA_COMPILER_COVERAGE_FLAGS}])
AC_SUBST([EXTRA_COMPILER_OPTIMIZATION_FLAGS],[${EXTRA_COMPILER_OPTIMIZATION_FLAGS}])
AC_SUBST([YAAL_LXXFLAGS],[${YAAL_LXXFLAGS}])
AC_SUBST([START_GROUP],[${START_GROUP}])
Expand Down
2 changes: 2 additions & 0 deletions _aux/cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ elseif ( "${CMAKE_BUILD_TYPE}" STREQUAL "cov" )
set( LIB_INFIX "-c" )
set( CMAKE_REQUIRED_LIBRARIES --coverage )
use_cxx_compiler_flag( --coverage )
use_cxx_compiler_flag( -femit-class-debug-always )
use_cxx_compiler_flag( -fno-eliminate-unused-debug-types )
set( CMAKE_SHARED_LINKER_FLAGS --coverage )
set( CMAKE_EXE_LINKER_FLAGS --coverage )
add_definitions( -D__DEBUG__ )
Expand Down
1 change: 1 addition & 0 deletions _aux/configure.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ GTAGS = @GTAGS@
START_GROUP = @START_GROUP@
END_GROUP = @END_GROUP@
EXTRA_COMPILER_DEBUG_FLAGS = @EXTRA_COMPILER_DEBUG_FLAGS@
EXTRA_COMPILER_COVERAGE_FLAGS = @EXTRA_COMPILER_COVERAGE_FLAGS@
EXTRA_COMPILER_OPTIMIZATION_FLAGS = @EXTRA_COMPILER_OPTIMIZATION_FLAGS@
EXTRA_INCLUDE_PATHS = @EXTRA_INCLUDE_PATHS@
EXTRA_LIBRARY_PATHS = @EXTRA_LIBRARY_PATHS@
Expand Down
2 changes: 1 addition & 1 deletion _aux/mk/60_flags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ endif
ifdef DO_COVERAGE
TARGET=cov
COMPILER_COVERAGE_FLAGS = --coverage
COMPILER_DEBUG_FLAGS = -D__DEBUG__ -fno-inline -fno-inline-small-functions -fno-default-inline
COMPILER_DEBUG_FLAGS = -D__DEBUG__ -fno-inline $(EXTRA_COMPILER_COVERAGE_FLAGS)
LINKER_COVERAGE_FLAGS = --coverage
LIB_INFIX = -c
endif
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ AC_SUBST([EXTRA_LIBRARY_PATHS], [${EXTRA_LIBRARY_PATHS}])
AC_SUBST([EXTRA_CXXFLAGS],[${EXTRA_CXXFLAGS}])
AC_SUBST([EXTRA_LXXFLAGS],[${EXTRA_LXXFLAGS}])
AC_SUBST([EXTRA_COMPILER_DEBUG_FLAGS],[${EXTRA_COMPILER_DEBUG_FLAGS}])
AC_SUBST([EXTRA_COMPILER_COVERAGE_FLAGS],[${EXTRA_COMPILER_COVERAGE_FLAGS}])
AC_SUBST([EXTRA_COMPILER_OPTIMIZATION_FLAGS],[${EXTRA_COMPILER_OPTIMIZATION_FLAGS}])
AC_SUBST([YAAL_LXXFLAGS],[${YAAL_LXXFLAGS}])
AC_SUBST([START_GROUP],[${START_GROUP}])
Expand Down
2 changes: 1 addition & 1 deletion tools/huginn/expression.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ inline HHuginn::value_t fill_assoc( HThread* thread_, HHuginn::value_t&& assoc_,
for ( int i( 0 ), S( static_cast<int>( values_.get_size() ) ); i < S; i += 2 ) {
dict->insert( thread_, values_[i]._value, values_[i + 1]._value, values_[i]._position );
}
return ( assoc_ );
return ( yaal::move( assoc_ ) );
}

}
Expand Down

0 comments on commit 992706a

Please sign in to comment.