Repository: parquet-cpp
Updated Branches:
  refs/heads/master 38e95ccde -> 410939c76


PARQUET-898: Upgrade to googletest 1.8.0, move back to Xcode 6.4 in Travis CI

Author: Wes McKinney <wes.mckin...@twosigma.com>

Closes #299 from wesm/PARQUET-898 and squashes the following commits:

f7c3055 [Wes McKinney] Override system openssl in OS X so Thrift 0.10 will build
d13c69e [Wes McKinney] Upgrade to googletest 1.8.0, move back to Xcode 6.4 in 
Travis CI


Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/410939c7
Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/410939c7
Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/410939c7

Branch: refs/heads/master
Commit: 410939c76f90f830fbc37c60ad175b6677ac02bf
Parents: 38e95cc
Author: Wes McKinney <wes.mckin...@twosigma.com>
Authored: Sun Apr 16 15:18:10 2017 -0400
Committer: Wes McKinney <wes.mckin...@twosigma.com>
Committed: Sun Apr 16 15:18:10 2017 -0400

----------------------------------------------------------------------
 .travis.yml                             |  5 +++--
 CMakeLists.txt                          | 14 +++++++++++-
 ci/before_script_travis.sh              |  3 +++
 cmake_modules/ThirdpartyToolchain.cmake | 33 +++++++++++++++-------------
 src/parquet/util/CMakeLists.txt         | 18 ---------------
 src/parquet/util/test_main.cc           | 26 ----------------------
 6 files changed, 37 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/410939c7/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index fffe8b0..f3c0c21 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,8 +42,9 @@ matrix:
     os: linux
   - compiler: clang
     os: linux
-  - os: osx
-    compiler: clang
+  - compiler: clang
+    os: osx
+    osx_image: xcode6.4
     addons:
     before_install:
     - mkdir $TRAVIS_BUILD_DIR/parquet-build

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/410939c7/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c3d91b..0809db4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -491,7 +491,19 @@ endif()
 # Test linking
 
 set(PARQUET_MIN_TEST_LIBS
-  parquet_test_main)
+  gtest
+  gtest_main)
+
+if (APPLE)
+  set(PARQUET_MIN_TEST_LIBS
+    ${PARQUET_MIN_TEST_LIBS}
+    ${CMAKE_DL_LIBS})
+elseif(NOT MSVC)
+  set(PARQUET_MIN_TEST_LIBS
+    ${PARQUET_MIN_TEST_LIBS}
+    pthread
+    ${CMAKE_DL_LIBS})
+endif()
 
 set(PARQUET_TEST_LINK_LIBS ${PARQUET_MIN_TEST_LIBS}
   ${ARROW_LINK_LIBS}

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/410939c7/ci/before_script_travis.sh
----------------------------------------------------------------------
diff --git a/ci/before_script_travis.sh b/ci/before_script_travis.sh
index 374f7c6..6742144 100755
--- a/ci/before_script_travis.sh
+++ b/ci/before_script_travis.sh
@@ -15,6 +15,9 @@
 if [ $TRAVIS_OS_NAME == "osx" ]; then
   brew update > /dev/null
   brew install boost
+  brew install openssl
+  export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
+  export LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$LD_LIBRARY_PATH
 else
   # Use a C++11 compiler on Linux
   export CC="gcc-4.9"

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/410939c7/cmake_modules/ThirdpartyToolchain.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/ThirdpartyToolchain.cmake 
b/cmake_modules/ThirdpartyToolchain.cmake
index 83aa1cc..30e4bab 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-set(GTEST_VERSION "1.7.0")
+set(GTEST_VERSION "1.8.0")
 set(GBENCHMARK_VERSION "1.1.0")
 set(SNAPPY_VERSION "1.1.3")
 set(THRIFT_VERSION "0.10.0")
@@ -267,29 +267,26 @@ if(PARQUET_BUILD_TESTS AND NOT IGNORE_OPTIONAL_PACKAGES)
 
     set(GTEST_PREFIX 
"${CMAKE_CURRENT_BINARY_DIR}/googletest_ep-prefix/src/googletest_ep")
     set(GTEST_INCLUDE_DIR "${GTEST_PREFIX}/include")
-    set(GTEST_STATIC_LIB 
"${GTEST_PREFIX}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    set(GTEST_STATIC_LIB
+      
"${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    set(GTEST_MAIN_STATIC_LIB
+      
"${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
     set(GTEST_VENDORED 1)
 
+    set(GTEST_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+                         -DCMAKE_INSTALL_PREFIX=${GTEST_PREFIX}
+                         -Dgtest_force_shared_crt=ON
+                         -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS})
+
     if (CMAKE_VERSION VERSION_GREATER "3.2")
       # BUILD_BYPRODUCTS is a 3.2+ feature
       ExternalProject_Add(googletest_ep
         URL 
"https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz";
-        CMAKE_ARGS -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS} 
-Dgtest_force_shared_crt=ON
-        # googletest doesn't define install rules, so just build in the
-        # source dir and don't try to install.  See its README for
-        # details.
-        BUILD_IN_SOURCE 1
-        BUILD_BYPRODUCTS "${GTEST_STATIC_LIB}"
-        INSTALL_COMMAND "")
+        CMAKE_ARGS ${GTEST_CMAKE_ARGS})
     else()
       ExternalProject_Add(googletest_ep
         URL 
"https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz";
-        CMAKE_ARGS -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS} 
-Dgtest_force_shared_crt=ON
-        # googletest doesn't define install rules, so just build in the
-        # source dir and don't try to install.  See its README for
-        # details.
-        BUILD_IN_SOURCE 1
-        INSTALL_COMMAND "")
+        CMAKE_ARGS ${GTEST_CMAKE_ARGS})
     endif()
   else()
     find_package(GTest REQUIRED)
@@ -299,11 +296,17 @@ if(PARQUET_BUILD_TESTS AND NOT IGNORE_OPTIONAL_PACKAGES)
   message(STATUS "GTest include dir: ${GTEST_INCLUDE_DIR}")
   message(STATUS "GTest static library: ${GTEST_STATIC_LIB}")
   include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
+
   add_library(gtest STATIC IMPORTED)
   set_target_properties(gtest PROPERTIES IMPORTED_LOCATION ${GTEST_STATIC_LIB})
 
+  add_library(gtest_main STATIC IMPORTED)
+  set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION
+    ${GTEST_MAIN_STATIC_LIB})
+
   if(GTEST_VENDORED)
     add_dependencies(gtest googletest_ep)
+    add_dependencies(gtest_main googletest_ep)
   endif()
 endif()
 

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/410939c7/src/parquet/util/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/parquet/util/CMakeLists.txt b/src/parquet/util/CMakeLists.txt
index 605b849..1778696 100644
--- a/src/parquet/util/CMakeLists.txt
+++ b/src/parquet/util/CMakeLists.txt
@@ -33,24 +33,6 @@ install(FILES
   visibility.h
   DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/parquet/util")
 
-if(PARQUET_BUILD_TESTS)
-  add_library(parquet_test_main
-       test_main.cc)
-  if (APPLE)
-       target_link_libraries(parquet_test_main
-      gtest
-      dl)
-       set_target_properties(parquet_test_main
-      PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
-  else()
-       target_link_libraries(parquet_test_main
-      dl
-      gtest
-      pthread
-         )
-  endif()
-endif()
-
 if (PARQUET_BUILD_BENCHMARKS)
   add_library(parquet_benchmark_main benchmark_main.cc)
   if (APPLE)

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/410939c7/src/parquet/util/test_main.cc
----------------------------------------------------------------------
diff --git a/src/parquet/util/test_main.cc b/src/parquet/util/test_main.cc
deleted file mode 100644
index 6fb7c05..0000000
--- a/src/parquet/util/test_main.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include <gtest/gtest.h>
-
-int main(int argc, char** argv) {
-  ::testing::InitGoogleTest(&argc, argv);
-
-  int ret = RUN_ALL_TESTS();
-
-  return ret;
-}

Reply via email to