Sfoglia il codice sorgente

Avoid passing -Og flag to C++ compiler

It appears that some versions of Clang do not support this flag, and
this came up as a problem for Homebrew builds in issue #5815.
Adam Cozzette 6 anni fa
parent
commit
45aba801ed
2 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 1 1
      src/Makefile.am
  2. 4 0
      tests.sh

+ 1 - 1
src/Makefile.am

@@ -888,7 +888,7 @@ no_warning_test.cc:
 
 no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
 no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
-                           -Wall -Wextra -Werror -Wno-unused-parameter -Og
+                           -Wall -Wextra -Werror -Wno-unused-parameter
 nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)
 
 TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \

+ 4 - 0
tests.sh

@@ -48,6 +48,10 @@ build_cpp_tcmalloc() {
 }
 
 build_cpp_distcheck() {
+  grep -q -- "-Og" src/Makefile.am &&
+    echo "The -Og flag is incompatible with Clang versions older than 4.0." &&
+    exit 1
+
   # Initialize any submodules.
   git submodule update --init --recursive
   ./autogen.sh