mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From josep...@apache.org
Subject [05/23] mesos git commit: CMake: Added variable for default linking strategy.
Date Tue, 29 Nov 2016 00:20:34 GMT
CMake: Added variable for default linking strategy.

The `MESOS_DEFAULT_LIBRARY_LINKAGE` changes all Mesos libraries to
the use specified linking strategy (static or shared).  This does
not affect third-party libraries, which have their own requirements.

On Posix, the default is shared linkage.  On Windows the default
is static linkage.

This review replaces: https://reviews.apache.org/r/49862/

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


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

Branch: refs/heads/master
Commit: 55fca1898d296b3479ae81e0c641c8c4a6bfed50
Parents: 94c1681
Author: Srinivas Brahmaroutu <srbrahma@us.ibm.com>
Authored: Mon Nov 28 15:32:32 2016 -0800
Committer: Joseph Wu <josephwu@apache.org>
Committed: Mon Nov 28 15:39:40 2016 -0800

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt                      | 8 +++++++-
 CMakeLists.txt                               | 2 +-
 cmake/MesosConfigure.cmake                   | 7 +++++++
 src/CMakeLists.txt                           | 6 ++----
 src/slave/qos_controllers/CMakeLists.txt     | 2 +-
 src/slave/resource_estimators/CMakeLists.txt | 2 +-
 6 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/55fca189/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 4dde6ec..cece6b5 100755
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -134,11 +134,17 @@ endif (NOT WIN32)
 set(LIBEVENT_CMAKE_ARGS
   ${LIBEVENT_CMAKE_ARGS}
   -LH
-  -DCMAKE_C_FLAGS=-fPIC
   -DEVENT__HAVE_SYS_STAT_H=1
   -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
   )
 
+if (NOT WIN32)
+  set(LIBEVENT_CMAKE_ARGS
+    ${LIBEVENT_CMAKE_ARGS}
+    -DCMAKE_C_FLAGS=-fPIC
+    )
+endif (NOT WIN32)
+
 # Third-party libraries. Tell the build system how to pull in and build third-
 # party libraries at compile time, using the ExternalProject_Add macro.
 ##############################################################################

http://git-wip-us.apache.org/repos/asf/mesos/blob/55fca189/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1362d65..399fe74 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,7 @@
 
 # THE MESOS PROJECT.
 ####################
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.10)
 
 project(Mesos)
 set(MESOS_MAJOR_VERSION 1)

http://git-wip-us.apache.org/repos/asf/mesos/blob/55fca189/cmake/MesosConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/MesosConfigure.cmake b/cmake/MesosConfigure.cmake
index de04389..82cdfb8 100755
--- a/cmake/MesosConfigure.cmake
+++ b/cmake/MesosConfigure.cmake
@@ -64,6 +64,13 @@ if (WIN32)
   file(WRITE ${CMAKE_BINARY_DIR}/make.bat ${MESOS_BUILD_CMD})
 endif (WIN32)
 
+if (WIN32)
+  set(MESOS_DEFAULT_LIBRARY_LINKAGE "STATIC")
+else (WIN32)
+  set(MESOS_DEFAULT_LIBRARY_LINKAGE "SHARED")
+  set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+endif (WIN32)
+
 # DEFINE DIRECTORY STRUCTURE MESOS PROJECT.
 ###########################################
 set(MESOS_SRC_DIR     ${CMAKE_SOURCE_DIR}/src)

http://git-wip-us.apache.org/repos/asf/mesos/blob/55fca189/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9ff47d7..b9fd134 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -497,20 +497,18 @@ link_directories(${AGENT_LIB_DIRS})
 
 # THE MESOS LIBRARY (generates, e.g., libmesos.so, etc., on Linux).
 ###################################################################
-add_library(${MESOS_TARGET} STATIC ${MESOS_SRC})
+add_library(${MESOS_TARGET} ${MESOS_DEFAULT_LIBRARY_LINKAGE} ${MESOS_SRC})
 set_target_properties(
   ${MESOS_TARGET} PROPERTIES
   VERSION ${MESOS_PACKAGE_VERSION}
   SOVERSION ${MESOS_PACKAGE_SOVERSION}
-  COMPILE_FLAGS "-fPIC"
   )
 
-add_library(${MESOS_PROTOBUF_TARGET} STATIC ${MESOS_PROTOBUF_SRC})
+add_library(${MESOS_PROTOBUF_TARGET} ${MESOS_DEFAULT_LIBRARY_LINKAGE} ${MESOS_PROTOBUF_SRC})
 set_target_properties(
   ${MESOS_PROTOBUF_TARGET} PROPERTIES
   VERSION ${MESOS_PACKAGE_VERSION}
   SOVERSION ${MESOS_PACKAGE_SOVERSION}
-  COMPILE_FLAGS "-fPIC"
   )
 
 # ADD LIBRARY DEPENDENCIES (tells CMake what to compile/build first).

http://git-wip-us.apache.org/repos/asf/mesos/blob/55fca189/src/slave/qos_controllers/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/slave/qos_controllers/CMakeLists.txt b/src/slave/qos_controllers/CMakeLists.txt
index 87c92af..e876e3e 100644
--- a/src/slave/qos_controllers/CMakeLists.txt
+++ b/src/slave/qos_controllers/CMakeLists.txt
@@ -23,7 +23,7 @@ set(QOS_CONTROLLER_SRC
 
 # THE AGENT EXECUTABLE.
 #######################
-add_library(${QOS_CONTROLLER_TARGET} SHARED ${QOS_CONTROLLER_SRC})
+add_library(${QOS_CONTROLLER_TARGET} ${MESOS_DEFAULT_LIBRARY_LINKAGE} ${QOS_CONTROLLER_SRC})
 
 # ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
 ######################################################

http://git-wip-us.apache.org/repos/asf/mesos/blob/55fca189/src/slave/resource_estimators/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/slave/resource_estimators/CMakeLists.txt b/src/slave/resource_estimators/CMakeLists.txt
index 17b149f..bf5c33c 100644
--- a/src/slave/resource_estimators/CMakeLists.txt
+++ b/src/slave/resource_estimators/CMakeLists.txt
@@ -23,7 +23,7 @@ set(RESOURCE_ESTIMATOR_SRC
 
 # THE AGENT EXECUTABLE.
 #######################
-add_library(${RESOURCE_ESTIMATOR_TARGET} SHARED ${RESOURCE_ESTIMATOR_SRC})
+add_library(${RESOURCE_ESTIMATOR_TARGET} ${MESOS_DEFAULT_LIBRARY_LINKAGE} ${RESOURCE_ESTIMATOR_SRC})
 
 # ADD LINKER FLAGS (generates, e.g., -lglog on Linux).
 ######################################################


Mime
View raw message