This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new 9839e2a  [AVRO-2202] Make sure -g is not removed for debug builds, 
only add GLIBCXX_DEBUG flags for our test builds
9839e2a is described below

commit 9839e2a67373a5cfd700182a15f949822ce3df99
Author: Daniel Kulp <[email protected]>
AuthorDate: Fri Apr 5 13:05:12 2019 -0400

    [AVRO-2202] Make sure -g is not removed for debug builds, only add 
GLIBCXX_DEBUG flags for our test builds
---
 lang/c++/CMakeLists.txt | 6 ++++--
 lang/c++/build.sh       | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lang/c++/CMakeLists.txt b/lang/c++/CMakeLists.txt
index 783a507..de99aac 100644
--- a/lang/c++/CMakeLists.txt
+++ b/lang/c++/CMakeLists.txt
@@ -56,13 +56,15 @@ else()
 endif()
 
 if (CMAKE_COMPILER_IS_GNUCXX)
-    set(CMAKE_CXX_FLAGS "-Wall")
-    set(CMAKE_CXX_FLAGS_DEBUG "-fstack-protector-all -D_GLIBCXX_DEBUG")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+if (AVRO_ADD_PROTECTOR_FLAGS)
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstack-protector-all 
-D_GLIBCXX_DEBUG")
     # Unset _GLIBCXX_DEBUG for avrogencpp.cc because using Boost Program 
Options
     # leads to linking errors when compiling with _GLIBCXX_DEBUG as described 
on
     # http://stackoverflow.com/questions/19729036/
     set_source_files_properties(impl/avrogencpp.cc PROPERTIES COMPILE_FLAGS 
"-U_GLIBCXX_DEBUG")
 endif ()
+endif ()
 
 
 find_package (Boost 1.38 REQUIRED
diff --git a/lang/c++/build.sh b/lang/c++/build.sh
index bdf2508..e6192f0 100755
--- a/lang/c++/build.sh
+++ b/lang/c++/build.sh
@@ -76,7 +76,7 @@ function do_dist() {
 
 case "$target" in
   test)
-    (cd build && cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug .. && 
make && cd .. \
+    (cd build && cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug -D 
AVRO_ADD_PROTECTOR_FLAGS=1 .. && make && cd .. \
       && ./build/buffertest \
       && ./build/unittest \
       && ./build/CodecTests \

Reply via email to