You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/09/03 12:51:43 UTC

[21/42] mesos git commit: CMake: Cleaned up mesos target linking rules.

CMake: Cleaned up mesos target linking rules.

Now that all the dependencies in 3rdparty are properly hooked up via
CMake targets, we can cleanup upstream targets that depend on them.

Review: https://reviews.apache.org/r/61297/
Review: https://reviews.apache.org/r/61298/
Review: https://reviews.apache.org/r/61299/
Review: https://reviews.apache.org/r/61310/
Review: https://reviews.apache.org/r/61326/
Review: https://reviews.apache.org/r/61341/
Review: https://reviews.apache.org/r/61342/
Review: https://reviews.apache.org/r/61349/
Review: https://reviews.apache.org/r/61356/
Review: https://reviews.apache.org/r/61359/
Review: https://reviews.apache.org/r/61364/


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

Branch: refs/heads/master
Commit: 9cdee131272b5cccc6c953c24537ade4c482e42f
Parents: 57cac23
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Sat Sep 2 15:28:49 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Sun Sep 3 05:51:07 2017 -0700

----------------------------------------------------------------------
 3rdparty/cmake/Mesos3rdpartyConfigure.cmake | 14 ------------
 cmake/CompilationConfigure.cmake            |  9 +-------
 cmake/MesosConfigure.cmake                  |  1 -
 src/CMakeLists.txt                          | 14 ++++--------
 src/master/cmake/MasterConfigure.cmake      | 27 ++++++------------------
 src/slave/cmake/AgentConfigure.cmake        | 27 ++++++------------------
 src/tests/CMakeLists.txt                    |  1 -
 src/tests/cmake/MesosTestsConfigure.cmake   | 10 ++-------
 8 files changed, 19 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
----------------------------------------------------------------------
diff --git a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
index 9a3a477..8cec807 100755
--- a/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
+++ b/3rdparty/cmake/Mesos3rdpartyConfigure.cmake
@@ -19,20 +19,6 @@
 set(MESOS_3RDPARTY_SRC ${CMAKE_SOURCE_DIR}/3rdparty)
 set(MESOS_3RDPARTY_BIN ${CMAKE_BINARY_DIR}/3rdparty)
 
-if (NOT WIN32)
-  # LevelDB does not build on Windows.
-  EXTERNAL("leveldb" ${LEVELDB_VERSION} "${MESOS_3RDPARTY_BIN}")
-endif ()
-
-# Convenience variables for include directories of third-party dependencies.
-set(LEVELDB_INCLUDE_DIR ${LEVELDB_ROOT}/include)
-
-# Convenience variables for "lflags", the symbols we pass to CMake to generate
-# things like `-L/path/to/glog` or `-lglog`.
-if (NOT WIN32)
-  set(LEVELDB_LFLAG   ${LEVELDB_ROOT}/out-static/libleveldb.a)
-endif ()
-
 # Configure Windows use of the GNU patch utility;
 # we attempt to find it in its default location,
 # but this path may be customized.

http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 2109697..5d54921 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -272,7 +272,7 @@ if (WIN32)
   # to give the build system fine-grained control over what code is #ifdef'd
   # out in the future.  Using only flags defined by our build system to control
   # this logic is the clearest and most stable way of accomplishing this.
-  list(APPEND MESOS_CPPFLAGS -D__WINDOWS__ -DHAVE_LIBZ)
+  list(APPEND MESOS_CPPFLAGS -D__WINDOWS__)
 
   # Defines to disable warnings generated by Visual Studio when using
   # deprecated functions in CRT and the use of insecure functions in CRT.
@@ -317,13 +317,6 @@ if (HAS_AUTHENTICATION)
   list(APPEND MESOS_CPPFLAGS -DHAS_AUTHENTICATION=1)
 endif ()
 
-# Enable the INT64 support for PicoJSON.
-# NOTE: PicoJson requires __STDC_FORMAT_MACROS to be defined before importing
-# 'inttypes.h'.  Since other libraries may also import this header, it must
-# be globally defined so that PicoJson has access to the macros, regardless
-# of the order of inclusion.
-list(APPEND MESOS_CPPFLAGS -DPICOJSON_USE_INT64 -D__STDC_FORMAT_MACROS)
-
 list(APPEND MESOS_CPPFLAGS
   -DPKGLIBEXECDIR="${PKG_LIBEXEC_INSTALL_DIR}"
   -DLIBDIR="${LIB_INSTALL_DIR}"

http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index 5ecad2c..48cc965 100755
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -55,7 +55,6 @@ include(CompilationConfigure)
 # NOTE: The third-party configuration variables exported here are used
 # throughout the project, so it's important that this config script goes here.
 include(Mesos3rdpartyConfigure)
-include(Process3rdpartyConfigure)
 
 if (BUILD_SHARED_LIBS)
   set(MESOS_DEFAULT_LIBRARY_LINKAGE "SHARED")

http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0bb23d7..2c5fbf6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -112,12 +112,6 @@ set(INTERNAL_PROTOBUF_SRC
 
 # BUILD PROTOBUFS.
 ##################
-include_directories(
-  ${MESOS_PROTOBUF_HEADER_INCLUDE_DIRS}
-  ${PROTOBUF_INCLUDE_DIR})
-
-link_directories(${PROTOBUF_LIB_DIR})
-
 add_library(
   ${MESOS_PROTOBUF_TARGET}
   ${MESOS_DEFAULT_LIBRARY_LINKAGE}
@@ -125,9 +119,10 @@ add_library(
   ${INTERNAL_PROTOBUF_SRC}
   )
 
-add_dependencies(${MESOS_PROTOBUF_TARGET} ${PROTOBUF_TARGET})
-
-target_link_libraries(${MESOS_PROTOBUF_TARGET} ${PROTOBUF_LFLAG})
+target_link_libraries(${MESOS_PROTOBUF_TARGET} PUBLIC protobuf)
+target_include_directories(
+  ${MESOS_PROTOBUF_TARGET} PUBLIC
+  ${MESOS_PROTOBUF_HEADER_INCLUDE_DIRS})
 
 if (WIN32)
   # Disable all compiler warnings on Protocol Buffers source.
@@ -588,7 +583,6 @@ endif ()
 add_dependencies(${MESOS_TARGET} ${MESOS_LIBS_TARGET})
 add_dependencies(
   ${MESOS_LIBS_TARGET}
-  ${MESOS_PROTOBUF_TARGET}
   ${AGENT_DEPENDENCIES}
   )
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/master/cmake/MasterConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/master/cmake/MasterConfigure.cmake b/src/master/cmake/MasterConfigure.cmake
index 96f0d5b..a5fbc45 100644
--- a/src/master/cmake/MasterConfigure.cmake
+++ b/src/master/cmake/MasterConfigure.cmake
@@ -14,15 +14,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# TODO(andschwa): Import this properly.
+set(SASL_LFLAG sasl2)
+
 # Define process library dependencies. Tells the process library build targets
 # download/configure/build all third-party libraries before attempting to build.
 ################################################################################
 set(MASTER_DEPENDENCIES
   ${MASTER_DEPENDENCIES}
-  ${PROCESS_DEPENDENCIES}
-  ${PROCESS_TARGET}
-  ${ZOOKEEPER_TARGET}
-  ${LEVELDB_TARGET}
   make_bin_include_dir
   make_bin_src_dir
   )
@@ -42,11 +41,6 @@ set(MASTER_INCLUDE_DIRS
 
 set(MASTER_3RDPARTY_INCLUDE_DIRS
   ${MASTER_3RDPARTY_INCLUDE_DIRS}
-  ${PROCESS_INCLUDE_DIRS}
-  ${PROCESS_3RDPARTY_INCLUDE_DIRS}
-  ${ZOOKEEPER_INCLUDE_DIR}
-  ${ZOOKEEPER_INCLUDE_GENDIR}
-  ${LEVELDB_INCLUDE_DIR}
   )
 
 # Define third-party lib install directories. Used to tell the compiler
@@ -55,8 +49,6 @@ set(MASTER_3RDPARTY_INCLUDE_DIRS
 ########################################################################
 set(MASTER_LIB_DIRS
   ${MASTER_LIB_DIRS}
-  ${PROCESS_LIB_DIRS}
-  ${ZOOKEEPER_LIB_DIR}
   )
 
 # Define third-party libs. Used to generate flags that the linker uses to
@@ -64,21 +56,14 @@ set(MASTER_LIB_DIRS
 #########################################################################
 set(MASTER_LIBS
   ${MASTER_LIBS}
-  ${PROCESS_LIBS}
-  ${ZOOKEEPER_LFLAG}
-  ${PROCESS_TARGET}
+  process
+  zookeeper
   )
 
 if (NOT WIN32)
   set(MASTER_LIBS
     ${MASTER_LIBS}
-    ${LEVELDB_LFLAG}
+    leveldb
     ${SASL_LFLAG}
     )
 endif ()
-
-if (NOT ENABLE_LIBEVENT)
-  set(MASTER_LIBS ${MASTER_LIBS} ${LIBEV_LFLAG})
-else ()
-  set(MASTER_LIBS ${MASTER_LIBS} ${LIBEVENT_LFLAG})
-endif ()

http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/slave/cmake/AgentConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/slave/cmake/AgentConfigure.cmake b/src/slave/cmake/AgentConfigure.cmake
index 0d70f91..4a06a4b 100644
--- a/src/slave/cmake/AgentConfigure.cmake
+++ b/src/slave/cmake/AgentConfigure.cmake
@@ -14,6 +14,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+# TODO(andschwa): Import this properly.
+set(SASL_LFLAG sasl2)
+
 set(LOGROTATE_CONTAINER_LOGGER_TARGET logrotate_container_logger
   CACHE STRING "Library containing the logrotate container logger."
   )
@@ -35,10 +38,6 @@ set(RESOURCE_ESTIMATOR_TARGET fixed_resource_estimator
 ################################################################################
 set(AGENT_DEPENDENCIES
   ${AGENT_DEPENDENCIES}
-  ${PROCESS_DEPENDENCIES}
-  ${PROCESS_TARGET}
-  ${ZOOKEEPER_TARGET}
-  ${LEVELDB_TARGET}
   make_bin_include_dir
   make_bin_src_dir
   )
@@ -58,11 +57,6 @@ set(AGENT_INCLUDE_DIRS
 
 set(AGENT_3RDPARTY_INCLUDE_DIRS
   ${AGENT_3RDPARTY_INCLUDE_DIRS}
-  ${PROCESS_INCLUDE_DIRS}
-  ${PROCESS_3RDPARTY_INCLUDE_DIRS}
-  ${ZOOKEEPER_INCLUDE_DIR}
-  ${ZOOKEEPER_INCLUDE_GENDIR}
-  ${LEVELDB_INCLUDE_DIR}
   )
 
 # Define third-party lib install directories. Used to tell the compiler
@@ -71,8 +65,6 @@ set(AGENT_3RDPARTY_INCLUDE_DIRS
 ########################################################################
 set(AGENT_LIB_DIRS
   ${AGENT_LIB_DIRS}
-  ${PROCESS_LIB_DIRS}
-  ${ZOOKEEPER_LIB_DIR}
   )
 
 # Define third-party libs. Used to generate flags that the linker uses to
@@ -80,21 +72,14 @@ set(AGENT_LIB_DIRS
 #########################################################################
 set(AGENT_LIBS
   ${AGENT_LIBS}
-  ${PROCESS_LIBS}
-  ${ZOOKEEPER_LFLAG}
-  ${PROCESS_TARGET}
+  process
+  zookeeper
   )
 
 if (NOT WIN32)
   set(AGENT_LIBS
     ${AGENT_LIBS}
-    ${LEVELDB_LFLAG}
+    leveldb
     ${SASL_LFLAG}
     )
 endif ()
-
-if (NOT ENABLE_LIBEVENT)
-  set(AGENT_LIBS ${AGENT_LIBS} ${LIBEV_LFLAG})
-else ()
-  set(AGENT_LIBS ${AGENT_LIBS} ${LIBEVENT_LFLAG})
-endif ()

http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 57bbe31..ac8db9c 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -14,7 +14,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-include(StoutTestsConfigure)
 include(MesosTestsConfigure)
 
 # Sources for a test helper binary.

http://git-wip-us.apache.org/repos/asf/mesos/blob/9cdee131/src/tests/cmake/MesosTestsConfigure.cmake
----------------------------------------------------------------------
diff --git a/src/tests/cmake/MesosTestsConfigure.cmake b/src/tests/cmake/MesosTestsConfigure.cmake
index 48b4d2f..8cf2d7f 100644
--- a/src/tests/cmake/MesosTestsConfigure.cmake
+++ b/src/tests/cmake/MesosTestsConfigure.cmake
@@ -52,7 +52,6 @@ add_definitions(-DSBINDIR="${S_BIN_DIR}")
 set(MESOS_TESTS_DEPENDENCIES
   ${MESOS_TESTS_DEPENDENCIES}
   ${MESOS_TARGET}
-  ${GOOGLETEST_TARGET}
   )
 
 # DEFINE THIRD-PARTY INCLUDE DIRECTORIES. Tells compiler toolchain where to get
@@ -66,8 +65,6 @@ set(MESOS_TESTS_INCLUDE_DIRS
 set(MESOS_3RDPARTY_TESTS_INCLUDE_DIRS
   ${MESOS_3RDPARTY_TESTS_INCLUDE_DIRS}
   ${AGENT_3RDPARTY_INCLUDE_DIRS}
-  ${GMOCK_INCLUDE_DIR}
-  ${GTEST_INCLUDE_DIR}
   )
 
 # DEFINE THIRD-PARTY LIB INSTALL DIRECTORIES. Used to tell the compiler
@@ -76,8 +73,6 @@ set(MESOS_3RDPARTY_TESTS_INCLUDE_DIRS
 ########################################################################
 set(MESOS_TESTS_LIB_DIRS
   ${MESOS_TESTS_LIB_DIRS}
-  ${GMOCK_LIB_DIR}
-  ${GTEST_LIB_DIR}
   )
 
 # DEFINE THIRD-PARTY LIBS. Used to generate flags that the linker uses to
@@ -86,10 +81,9 @@ set(MESOS_TESTS_LIB_DIRS
 set(MESOS_TESTS_LIBS
   ${MESOS_TESTS_LIBS}
   ${MESOS_LIBS_TARGET}
-  ${PROCESS_TARGET}
   ${MESOS_LIBS}
-  ${GMOCK_LFLAG}
-  ${GTEST_LFLAG}
+  process
+  googletest
   )
 
 if (NOT WIN32)