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 2016/11/29 00:20:40 UTC

[11/23] mesos git commit: CMake: Change libprocess to a shared library.

CMake: Change libprocess to a shared library.

In order to load modules that are themselves based on libprocess,
we must link libprocess as a shared library.  Since modules are
only supported on non-Windows platforms, this changes the default
linking mode to SHARED on non-Windows.

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

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


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

Branch: refs/heads/master
Commit: c8f249b3d9f0c0b0d5fce4da26c63190d6e1d0fc
Parents: 4c741df
Author: Srinivas Brahmaroutu <sr...@us.ibm.com>
Authored: Mon Nov 28 15:32:38 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Nov 28 15:40:04 2016 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/CMakeLists.txt | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c8f249b3/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index d1547ef..a815a6b 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -87,13 +87,23 @@ link_directories(${PROCESS_LIB_DIRS})
 
 # THE PROCESS LIBRARY (generates, e.g., libprocess.so, etc., on Linux).
 #######################################################################
-add_library(${PROCESS_TARGET} STATIC ${PROCESS_SRC})
+if (WIN32)
+  add_library(${PROCESS_TARGET} STATIC ${PROCESS_SRC})
+else (WIN32)
+  add_library(${PROCESS_TARGET} SHARED ${PROCESS_SRC})
+
+  set_target_properties(
+    ${PROCESS_TARGET} PROPERTIES
+    POSITION_INDEPENDENT_CODE TRUE
+    )
+endif (WIN32)
+
 set_target_properties(
   ${PROCESS_TARGET} PROPERTIES
   VERSION ${PROCESS_PACKAGE_VERSION}
   SOVERSION ${PROCESS_PACKAGE_SOVERSION}
-  COMPILE_FLAGS "-fPIC"
   )
+
 add_dependencies(${PROCESS_TARGET} ${PROCESS_DEPENDENCIES})
 
 # ADD LINKER FLAGS (generates, e.g., -lglog on Linux).