parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject parquet-cpp git commit: PARQUET-986: Improve MSVC build - ThirdpartyToolchain - Thrift
Date Mon, 22 May 2017 20:14:52 GMT
Repository: parquet-cpp
Updated Branches:
  refs/heads/master 3866e3c24 -> b5d9117dd


PARQUET-986: Improve MSVC build - ThirdpartyToolchain - Thrift

Author: rip.nsk <rip.nsk@gmail.com>

Closes #336 from rip-nsk/PARQUET-986 and squashes the following commits:

03a227a [rip.nsk] Fix 'Thrift NOT found' message
6dd2e5a [rip.nsk] Improve definition of THRIFT_STATIC_LIB NAME and ensure it is "MD" build.
140c6cb [rip.nsk] Remove vendored libevent.
3e68a79 [rip.nsk] Replace flex_step by winflexbison_ep and fix dependency on zlib_ep


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

Branch: refs/heads/master
Commit: b5d9117dd0e38bc8f50610bec75074f534606883
Parents: 3866e3c
Author: rip.nsk <rip.nsk@gmail.com>
Authored: Mon May 22 16:14:46 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Mon May 22 16:14:46 2017 -0400

----------------------------------------------------------------------
 cmake_modules/FindThrift.cmake          | 19 ++++--
 cmake_modules/ThirdpartyToolchain.cmake | 88 ++++++++++------------------
 2 files changed, 46 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/b5d9117d/cmake_modules/FindThrift.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindThrift.cmake b/cmake_modules/FindThrift.cmake
index 6c5d9fe..25f5082 100644
--- a/cmake_modules/FindThrift.cmake
+++ b/cmake_modules/FindThrift.cmake
@@ -74,13 +74,24 @@ else ()
 endif ()
 
 if (THRIFT_FOUND)
-  if (NOT THRIFT_FIND_QUIETLY)
+  if (NOT Thrift_FIND_QUIETLY)
     message(STATUS "Thrift version: ${THRIFT_VERSION}")
   endif ()
 else ()
-  message(STATUS "Thrift compiler/libraries NOT found. "
-          "Thrift support will be disabled (${THRIFT_RETURN}, "
-          "${THRIFT_INCLUDE_DIR}, ${THRIFT_STATIC_LIB})")
+  if (NOT Thrift_FIND_QUIETLY)
+    set(THRIFT_ERR_MSG "Thrift compiler/libraries NOT found: ${THRIFT_RETURN}")
+    set(THRIFT_ERR_MSG "${THRIFT_ERR_MSG} (${THRIFT_INCLUDE_DIR}, ${THRIFT_STATIC_LIB}).")
+    if ( _thrift_roots )
+      set(THRIFT_ERR_MSG "${THRIFT_ERR_MSG} Looked in ${_thrift_roots}.")
+    else ()
+      set(THRIFT_ERR_MSG "${THRIFT_ERR_MSG} Looked in system search paths.")
+    endif ()
+    if ( Thrift_FIND_REQUIRED )
+      message(FATAL_ERROR "${THRIFT_ERR_MSG}")
+    else ()
+      message(STATUS "${THRIFT_ERR_MSG}")
+    endif ()
+  endif ()
 endif ()
 
 

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/b5d9117d/cmake_modules/ThirdpartyToolchain.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
index b40d101..edbb961 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -179,21 +179,8 @@ if (NOT THRIFT_FOUND)
   set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep/src/thrift_ep-install")
   set(THRIFT_HOME "${THRIFT_PREFIX}")
   set(THRIFT_INCLUDE_DIR "${THRIFT_PREFIX}/include")
-  IF (${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG")
-    IF (MSVC)
-      set(THRIFT_STATIC_LIB "${THRIFT_PREFIX}/lib/thriftmdd.lib")
-    ELSE()
-      set(THRIFT_STATIC_LIB "${THRIFT_PREFIX}/lib/libthriftd.a")
-    ENDIF()
-  ELSE()
-    IF (MSVC)
-      set(THRIFT_STATIC_LIB "${THRIFT_PREFIX}/lib/thriftmd.lib")
-    ELSE()
-      set(THRIFT_STATIC_LIB "${THRIFT_PREFIX}/lib/libthrift.a")
-    ENDIF()
-  ENDIF()
   set(THRIFT_COMPILER "${THRIFT_PREFIX}/bin/thrift")
-  set(THRIFT_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+  set(THRIFT_CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
                         "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}"
                         "-DCMAKE_C_FLAGS=${EP_C_FLAGS}"
                         "-DCMAKE_INSTALL_PREFIX=${THRIFT_PREFIX}"
@@ -207,16 +194,37 @@ if (NOT THRIFT_FOUND)
                         "-DWITH_CPP=ON"
                         "-DWITH_STATIC_LIB=ON"
                         )
+
+  set(THRIFT_STATIC_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}thrift")
+  if (MSVC)
+    set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}md")
+    set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DWITH_MT=OFF")
+  endif()
+  if (${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG")
+    set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}d")
+  endif()
+  set(THRIFT_STATIC_LIB "${THRIFT_PREFIX}/lib/${THRIFT_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+
   if (MSVC)
-    set (THRIFT_CMAKE_ARGS "-DLIBEVENT_ROOT=${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-prefix/src/thrift_ep/thirdparty/src/Libevent-release-2.1.7-rc"
-                           "-DFLEX_EXECUTABLE=${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-prefix/src/thrift_ep/thirdparty/dist/winflexbison/win_flex.exe"
-                           "-DBISON_EXECUTABLE=${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-prefix/src/thrift_ep/thirdparty/dist/winflexbison/win_bison.exe"
-                           "-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}"
-                           "-DZLIB_LIBRARY=${ZLIB_STATIC_LIB}"
-                           "-DWITH_SHARED_LIB=OFF"
-                           "-DWITH_PLUGIN=OFF"
-                           ${THRIFT_CMAKE_ARGS})
-    set (THRIFT_DEPENDENCIES zlib_ep)
+    set(WINFLEXBISON_VERSION 2.4.9)
+    set(WINFLEXBISON_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/winflexbison_ep/src/winflexbison_ep-install")
+    ExternalProject_Add(winflexbison_ep
+      URL https://github.com/lexxmark/winflexbison/releases/download/v.${WINFLEXBISON_VERSION}/win_flex_bison-${WINFLEXBISON_VERSION}.zip
+      URL_HASH MD5=a2e979ea9928fbf8567e995e9c0df765
+      SOURCE_DIR ${WINFLEXBISON_PREFIX}
+      CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "")
+    set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} winflexbison_ep)
+
+    set(THRIFT_CMAKE_ARGS "-DFLEX_EXECUTABLE=${WINFLEXBISON_PREFIX}/win_flex.exe"
+                          "-DBISON_EXECUTABLE=${WINFLEXBISON_PREFIX}/win_bison.exe"
+                          "-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}"
+                          "-DZLIB_LIBRARY=${ZLIB_STATIC_LIB}"
+                          "-DWITH_SHARED_LIB=OFF"
+                          "-DWITH_PLUGIN=OFF"
+                          ${THRIFT_CMAKE_ARGS})
+    if (ZLIB_VENDORED)
+      set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} zlib_ep)
+    endif()
   endif()
 
   if (CMAKE_VERSION VERSION_GREATER "3.2")
@@ -226,42 +234,8 @@ if (NOT THRIFT_FOUND)
     URL "http://archive.apache.org/dist/thrift/${THRIFT_VERSION}/thrift-${THRIFT_VERSION}.tar.gz"
     ${THRIFT_BUILD_BYPRODUCTS}
     CMAKE_ARGS ${THRIFT_CMAKE_ARGS}
-    STEP_TARGETS flex_step libevent_step
     DEPENDS ${THRIFT_DEPENDENCIES})
 
-  if (MSVC)
-    ExternalProject_Get_Property(thrift_ep SOURCE_DIR)
-
-    set(WINFLEXBISON_VERSION 2.4.9)
-    set(LIBEVENT_VERSION 2.1.7)
-
-    # Download and configure Windows build of Flex and Bison
-    ExternalProject_Add_Step(thrift_ep flex_step
-      COMMAND ${CMAKE_COMMAND} -E make_directory thirdparty/dist/winflexbison
-      COMMAND cd thirdparty/dist/winflexbison
-      COMMAND curl -SLO https://github.com/lexxmark/winflexbison/releases/download/v.${WINFLEXBISON_VERSION}/win_flex_bison-${WINFLEXBISON_VERSION}.zip
-      COMMAND ${CMAKE_COMMAND} -E tar xzf win_flex_bison-${WINFLEXBISON_VERSION}.zip
-      DEPENDERS configure
-      DEPENDEES download
-      WORKING_DIRECTORY ${SOURCE_DIR})
-
-    # Download and build libevent
-    ExternalProject_Add_Step(thrift_ep libevent_step
-      COMMAND ${CMAKE_COMMAND} -E make_directory thirdparty/src
-      COMMAND cd thirdparty/src
-      COMMAND curl -SLO https://github.com/nmathewson/Libevent/archive/release-${LIBEVENT_VERSION}-rc.zip
-      COMMAND ${CMAKE_COMMAND} -E tar xzf release-${LIBEVENT_VERSION}-rc.zip
-      COMMAND cd Libevent-release-${LIBEVENT_VERSION}-rc
-      COMMAND ${CMAKE_COMMAND} -E make_directory build
-      COMMAND cd build
-      COMMAND ${CMAKE_COMMAND} -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=.. ..
-      COMMAND nmake
-      COMMAND nmake install
-      DEPENDERS configure
-      DEPENDEES download
-      WORKING_DIRECTORY ${SOURCE_DIR})
-  endif()
-
   set(THRIFT_VENDORED 1)
 else()
   set(THRIFT_VENDORED 0)


Mime
View raw message