You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2015/04/16 22:23:50 UTC

thrift git commit: THRIFT-3099 cmake build is broken on FreeBSD

Repository: thrift
Updated Branches:
  refs/heads/master 3b61971c8 -> 83494259d


THRIFT-3099 cmake build is broken on FreeBSD


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/83494259
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/83494259
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/83494259

Branch: refs/heads/master
Commit: 83494259d1ee7657b90bf8f2c234a3133cde8fa9
Parents: 3b61971
Author: Marco Molteni <ma...@laposte.net>
Authored: Thu Apr 16 13:50:20 2015 +0200
Committer: Roger Meier <ro...@apache.org>
Committed: Thu Apr 16 22:23:27 2015 +0200

----------------------------------------------------------------------
 build/cmake/DefineOptions.cmake          |  2 +-
 build/cmake/DefinePlatformSpecifc.cmake  | 12 +++++++++---
 lib/c_glib/test/CMakeLists.txt           |  2 ++
 lib/c_glib/test/testthrifttestclient.cpp | 10 +++++-----
 lib/cpp/test/TransportTest.cpp           |  6 ++++++
 test/cpp/CMakeLists.txt                  |  1 +
 6 files changed, 24 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/83494259/build/cmake/DefineOptions.cmake
----------------------------------------------------------------------
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 7d8b032..a8b40c2 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -39,7 +39,7 @@ CMAKE_DEPENDENT_OPTION(WITH_CPP "Build C++ library" ON
                        "BUILD_LIBRARIES;Boost_FOUND" OFF)
 # NOTE: Currently the following options are C++ specific,
 # but in future other libraries might reuse them.
-# So they are not dependent on WIHT_CPP but setting them without WITH_CPP currently
+# So they are not dependent on WITH_CPP but setting them without WITH_CPP currently
 # has no effect.
 find_package(ZLIB QUIET)
 CMAKE_DEPENDENT_OPTION(WITH_ZLIB "Build with ZLIB support" ON

http://git-wip-us.apache.org/repos/asf/thrift/blob/83494259/build/cmake/DefinePlatformSpecifc.cmake
----------------------------------------------------------------------
diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake
index bafbf49..63e78f4 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -68,8 +68,14 @@ elseif(UNIX)
 
 endif()
 
-# GCC Specific
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-  # TODO: -pedantic can not be used at the moment because of: https://issues.apache.org/jira/browse/THRIFT-2784
+# GCC and Clang.
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  # FIXME -pedantic can not be used at the moment because of: https://issues.apache.org/jira/browse/THRIFT-2784
   #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -pedantic")
+  # FIXME enabling c++11 breaks some Linux builds on Travis by triggering a g++ bug, see
+  # https://travis-ci.org/apache/thrift/jobs/58017022
+  # on the other hand, both MacOSX and FreeBSD need c++11
+  if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra")
+  endif()
 endif()

http://git-wip-us.apache.org/repos/asf/thrift/blob/83494259/lib/c_glib/test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/CMakeLists.txt b/lib/c_glib/test/CMakeLists.txt
index affa455..e3e5ea4 100644
--- a/lib/c_glib/test/CMakeLists.txt
+++ b/lib/c_glib/test/CMakeLists.txt
@@ -23,6 +23,8 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}")
 
 set(TEST_PREFIX "c_glib")
 
+include_directories(${Boost_INCLUDE_DIRS})
+
 # Create the thrift C++ test library
 set(testgenc_SOURCES
     gen-c_glib/t_test_debug_proto_test_types.c

http://git-wip-us.apache.org/repos/asf/thrift/blob/83494259/lib/c_glib/test/testthrifttestclient.cpp
----------------------------------------------------------------------
diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index 0a711d6..4f7bc08 100755
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -591,11 +591,11 @@ main (int argc, char **argv)
 
   if (pid == 0) /* child */
   {
-    shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
-    shared_ptr<TestHandler> testHandler(new TestHandler());
-    shared_ptr<ThriftTestProcessor> testProcessor(new ThriftTestProcessor(testHandler));
-    shared_ptr<TServerSocket> serverSocket(new TServerSocket(TEST_PORT));
-    shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
+    boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
+    boost::shared_ptr<TestHandler> testHandler(new TestHandler());
+    boost::shared_ptr<ThriftTestProcessor> testProcessor(new ThriftTestProcessor(testHandler));
+    boost::shared_ptr<TServerSocket> serverSocket(new TServerSocket(TEST_PORT));
+    boost::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
     TSimpleServer simpleServer(testProcessor, serverSocket, transportFactory, protocolFactory);
     signal (SIGALRM, bailout);
     alarm (60);

http://git-wip-us.apache.org/repos/asf/thrift/blob/83494259/lib/cpp/test/TransportTest.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index 451fcef..7bd8aa0 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -16,8 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
+#include "config.h"
+
 #include <stdlib.h>
 #include <time.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
 #include <sstream>
 #include <fstream>
 #include <thrift/cxxfunctional.h>

http://git-wip-us.apache.org/repos/asf/thrift/blob/83494259/test/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt
index d993c6d..79cc008 100755
--- a/test/cpp/CMakeLists.txt
+++ b/test/cpp/CMakeLists.txt
@@ -31,6 +31,7 @@ set(crosstestgencpp_SOURCES
     gen-cpp/ThriftTest.cpp
     gen-cpp/ThriftTest_types.cpp
     gen-cpp/ThriftTest_constants.cpp
+    src/ThriftTest_extras.cpp
 )
 add_library(crosstestgencpp STATIC ${crosstestgencpp_SOURCES})
 target_link_libraries(crosstestgencpp thrift)