From b6dae554fe9c39b076947a7da83a3a7b01521296 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 15 Jun 2010 16:45:11 -0400 Subject: Don't build gcov Ledger with asserts enabled --- acprep | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'acprep') diff --git a/acprep b/acprep index dac869dd..f0784f8a 100755 --- a/acprep +++ b/acprep @@ -955,7 +955,10 @@ class PrepareBuild(CommandLineApp): else: gcc_version = "42" - if self.current_flavor == 'debug' or self.current_flavor == 'gcov': + if gcc_version != "42": + self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1') + + if self.current_flavor == 'debug': if exists('/usr/local/stow/cppunit-gcc%s/include' % gcc_version): self.sys_include_dirs.insert( 0, '/usr/local/stow/cppunit-gcc%s/include' % gcc_version) @@ -968,10 +971,11 @@ class PrepareBuild(CommandLineApp): self.sys_library_dirs.insert( 0, '/usr/local/stow/icu-gcc%s/lib' % gcc_version) - self.CPPFLAGS.append('-D_GLIBCXX_FULLY_DYNAMIC_STRING=1') self.configure_args.append('--disable-shared') self.options.use_glibcxx_debug = True + elif self.current_flavor == 'gcov': + self.configure_args.append('--disable-shared') else: self.CXXFLAGS.append('-march=nocona') self.CXXFLAGS.append('-msse3') @@ -1201,7 +1205,7 @@ class PrepareBuild(CommandLineApp): self.log.debug('Using gcc version: %s' % gcc_version) - if self.current_flavor == 'debug' or self.current_flavor == 'gcov': + if self.current_flavor == 'debug': if self.options.use_glibcxx_debug: self.log.debug('We are using GLIBCXX_DEBUG, so setting up flags') self.CPPFLAGS.append('-D_GLIBCXX_DEBUG=1') @@ -1282,6 +1286,9 @@ class PrepareBuild(CommandLineApp): self.LDFLAGS.append(i) def setup_flavor_gcov(self): + # NDEBUG is set so that branch coverage ignores the never-taken else + # branch inside assert statements. + self.CPPFLAGS.append('-DNDEBUG=1') self.CXXFLAGS.append('-g') self.CXXFLAGS.append('-fprofile-arcs') self.CXXFLAGS.append('-ftest-coverage') -- cgit v1.2.3