From 42c81e1a764d565823c203e9e07376379639ffa7 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Wed, 6 May 2009 01:15:06 +0000 Subject: Set better default CXXFLAGS and don't use optimization when compiling tests (takes too long). --- src/Makefile.am | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 902e6af8..260834de 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,11 +12,13 @@ endif if GCC # These are good warnings to turn on by default -AM_CXXFLAGS = $(PTHREAD_CFLAGS) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare +NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare else -AM_CXXFLAGS = $(PTHREAD_CFLAGS) +NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) endif +AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) + AM_LDFLAGS = $(PTHREAD_CFLAGS) # If I say "dist_include_DATA", automake complains that $(includedir) is not @@ -234,6 +236,10 @@ protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \ $(top_builddir)/gtest/lib/libgtest_main.la protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \ -I$(top_builddir)/gtest/include +# Disable optimization for tests unless the user explicitly asked for it, +# since test_util.cc takes forever to compile with optimization (with GCC). +# See configure.ac for more info. +protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS) protobuf_test_SOURCES = \ google/protobuf/stubs/common_unittest.cc \ google/protobuf/stubs/once_unittest.cc \ -- cgit v1.2.3