aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-05-06 01:15:06 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-05-06 01:15:06 +0000
commit42c81e1a764d565823c203e9e07376379639ffa7 (patch)
tree65325ea33de3b38f5f75cfe9d04c517aff10431d /src/Makefile.am
parent3d694ad2d883a84b7ca0b7148c636ee7897ef326 (diff)
downloadprotobuf-42c81e1a764d565823c203e9e07376379639ffa7.tar.gz
protobuf-42c81e1a764d565823c203e9e07376379639ffa7.tar.bz2
protobuf-42c81e1a764d565823c203e9e07376379639ffa7.zip
Set better default CXXFLAGS and don't use optimization when compiling tests
(takes too long).
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am10
1 files changed, 8 insertions, 2 deletions
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 \