You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/02/29 10:02:18 UTC

mesos git commit: CMake: Moved Windows build to version of glog that builds with CMake.

Repository: mesos
Updated Branches:
  refs/heads/master 1ecec7946 -> 7918dff39


CMake: Moved Windows build to version of glog that builds with CMake.

Review: https://reviews.apache.org/r/43415/


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

Branch: refs/heads/master
Commit: 7918dff390e56aaff7ee35f96ec2fc91b055609f
Parents: 1ecec79
Author: Alex Clemmer <cl...@gmail.com>
Authored: Mon Feb 29 03:45:40 2016 -0500
Committer: Michael Park <mp...@apache.org>
Committed: Mon Feb 29 04:02:03 2016 -0500

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/CMakeLists.txt     | 37 +++++++-------------
 .../cmake/Process3rdpartyConfigure.cmake        | 13 ++++---
 2 files changed, 19 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7918dff3/3rdparty/libprocess/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/CMakeLists.txt b/3rdparty/libprocess/3rdparty/CMakeLists.txt
index 99f48c2..62b61a1 100644
--- a/3rdparty/libprocess/3rdparty/CMakeLists.txt
+++ b/3rdparty/libprocess/3rdparty/CMakeLists.txt
@@ -42,29 +42,20 @@ endif (REBUNDLED)
 set(LIBEVENT_URL ${UPSTREAM_URL}/libevent-release-${LIBEVENT_VERSION}.tar.gz)
 
 if (WIN32)
-  # TODO(hausdorff): (MESOS-3394) Upgrade Windows to use glog v0.3.5, as that
-  # release will contain fixes that will allow us to build glog on Windows.
-  #
-  # NOTE: hausdorff has ported glog v0.3.4 to support compilation with MSVC
-  # 1900 (it works on MSVC 1800, but not 1900). The patch has been submitted
-  # to the glog project which you can see in pull request #43[1].
-  #
-  # Note also that this tarball actually points directly at the branch the
-  # PR is issued from, and uses the GitHub REST API to get a tarball of it.
-  # We think this is stictly better than pulling a tarball out of 3rdparty, or
-  # running `patch` on a tarball version of the vanilla 0.3.4 release, because
-  # it means that this code will automatically be up-to-date, and to transition
-  # to the next release of glog (when this will presumably be fixed), we need
-  # only change this line.
+  # TODO(hausdorff): (MESOS-3394) Upgrade Windows to use glog v0.3.5 when they
+  # release it, as that will contain fixes that will allow us to build glog on
+  # Windows, as well as build using CMake directly. For now, we simply point
+  # Windows builds at a commit hash in the glog history that has all the
+  # functionality we want.
   #
   # Finally, for our third-party libraries, MSVC 1800 and 1900 are not
   # linker-compatible, so it's important for us to be able to build glog
   # (as well as all the other third-party dependencies) on MSVC 1900.
   #
   # [1] https://github.com/google/glog/pull/43
-  set(GLOG_URL     https://github.com/hausdorff/glog/tarball/glog-${GLOG_VERSION}-msvc1900)
-  set(CURL_URL     ${UPSTREAM_URL}/curl-static-${CURL_VERSION}.tar.gz)
-  set(LIBAPR_URL   ${UPSTREAM_URL}/libapr-${LIBAPR_VERSION}.tar.gz)
+  set(GLOG_URL   ${UPSTREAM_URL}/glog-v0.3.4-g4d391fe.tar.gz)
+  set(CURL_URL   ${UPSTREAM_URL}/curl-static-${CURL_VERSION}.tar.gz)
+  set(LIBAPR_URL ${UPSTREAM_URL}/libapr-${LIBAPR_VERSION}.tar.gz)
 endif (WIN32)
 
 # Define build/patch/configure commands for third-party libs.
@@ -107,14 +98,7 @@ if (NOT WIN32)
 
   set(LIBEVENT_INSTALL_CMD mkdir -p ${LIBEVENT_LIB_ROOT} && cp -r ${LIBEVENT_ROOT}-build/lib/. ${LIBEVENT_LIB_DIR} && cp -r ${LIBEVENT_ROOT}-build/include/. ${LIBEVENT_INCLUDE_DIR} && cp -r ${LIBEVENT_ROOT}/include/. ${LIBEVENT_INCLUDE_DIR})
 elseif (WIN32)
-  set(GLOG_PATCH_CMD   ${CMAKE_NOOP})
-  set(GLOG_CONFIG_CMD  ${CMAKE_NOOP})
   set(GLOG_INSTALL_CMD ${CMAKE_NOOP})
-  VS_BUILD_CMD(
-      GLOG
-      ${GLOG_ROOT}/google-glog.sln
-      ${CMAKE_BUILD_TYPE}
-      "libglog")
 
   set(LIBEVENT_INSTALL_CMD ${CMAKE_NOOP})
 
@@ -150,9 +134,14 @@ ExternalProject_Add(
   URL               ${BOOST_URL}
   )
 
+# The patch, configure, build, and install commands are stubbed out on Windows
+# builds so that it defaults to build using CMake. This is for the same reason
+# as the GMock code library build, see the call to `ExternalProject_Add` for
+# the GMock project below for more details.
 ExternalProject_Add(
   ${GLOG_TARGET}
   PREFIX            ${GLOG_CMAKE_ROOT}
+  CMAKE_ARGS        -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
   PATCH_COMMAND     ${GLOG_PATCH_CMD}
   CONFIGURE_COMMAND ${GLOG_CONFIG_CMD}
   BUILD_COMMAND     ${GLOG_BUILD_CMD}

http://git-wip-us.apache.org/repos/asf/mesos/blob/7918dff3/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
index b7b61f6..cc9bc5a 100644
--- a/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
+++ b/3rdparty/libprocess/cmake/Process3rdpartyConfigure.cmake
@@ -76,7 +76,7 @@ set(LIBEV_LIB_DIR       ${LIBEV_ROOT}-build/.libs)
 
 if (WIN32)
   set(CURL_LIB_DIR     ${CURL_ROOT}/lib)
-  set(GLOG_LIB_DIR     ${GLOG_ROOT}/${CMAKE_BUILD_TYPE})
+  set(GLOG_LIB_DIR     ${GLOG_ROOT}-build/${CMAKE_BUILD_TYPE})
   set(LIBEVENT_LIB_DIR ${LIBEVENT_ROOT}-build/lib)
   set(PROTOBUF_LIB_DIR ${PROTOBUF_ROOT}/vsprojects/${CMAKE_BUILD_TYPE})
 else (WIN32)
@@ -90,20 +90,19 @@ endif (WIN32)
 set(HTTP_PARSER_LFLAG http_parser)
 set(LIBEV_LFLAG       ev)
 set(LIBEVENT_LFLAG    event)
+set(GLOG_LFLAG        glog)
 
 if (WIN32)
-  # Necessary because the lib names for (e.g.) glog are generated incorrectly
-  # on Windows. That is, on *nix, the glog binary should be (e.g.) libglog.so,
-  # and on Windows it should be glog.lib. But on Windows, it's actually
-  # libglog.lib. Hence, we have to special case it here because CMake assumes
+  # Necessary because the lib names for (e.g.) curl are generated incorrectly
+  # on Windows. That is, on *nix, the curl binary should be (e.g.) libcurl.so,
+  # and on Windows it should be curl.lib. But on Windows, it's actually
+  # libcurl.lib. Hence, we have to special case it here because CMake assumes
   # the library names are generated correctly.
   set(CURL_LFLAG     libcurl_a)
-  set(GLOG_LFLAG     libglog)
   set(PROTOBUF_LFLAG libprotobuf)
 else (WIN32)
   set(CURL_LFLAG     curl)
   set(DL_LFLAG       dl)
-  set(GLOG_LFLAG     glog)
   set(PROTOBUF_LFLAG protobuf)
   set(SASL_LFLAG     sasl2)
 endif (WIN32)