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/03/01 19:30:03 UTC
[07/11] mesos git commit: CMake: Started to require 64-bit builds.
CMake: Started to require 64-bit builds.
Review: https://reviews.apache.org/r/43689/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ded4544d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ded4544d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ded4544d
Branch: refs/heads/master
Commit: ded4544d3dfa866d5ac2844286891e881cf11f96
Parents: 046a29e
Author: Alex Clemmer <cl...@gmail.com>
Authored: Mon Feb 29 15:30:47 2016 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Tue Mar 1 10:25:44 2016 -0800
----------------------------------------------------------------------
cmake/CompilationConfigure.cmake | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/ded4544d/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index ab503b2..f491901 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -16,8 +16,24 @@
# CONFIGURE COMPILATION.
########################
+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." FALSE)
+
string(COMPARE EQUAL ${CMAKE_SYSTEM_NAME} "Linux" LINUX)
+# Check that we are targeting a 64-bit architecture.
+if (NOT (CMAKE_SIZEOF_VOID_P EQUAL 8))
+ message(
+ FATAL_ERROR
+ "Mesos requires that we compile to a 64-bit target. Following are some "
+ "examples of how to accomplish this on some well-used platforms:\n"
+ " * Linux: (on gcc) set `CMAKE_CXX_FLAGS` to include `-m64`:\n"
+ " `cmake -DCMAKE_CXX_FLAGS=-m64 `.\n"
+ " * Windows: use the VS win64 CMake generator:\n"
+ " `cmake -G \"Visual Studio 10 Win64\"`.\n"
+ " * OS X: add `x86_64` to the `CMAKE_OSX_ARCHITECTURES`:\n"
+ " `cmake -DCMAKE_OSX_ARCHITECTURES=x86_64`.\n")
+endif (NOT (CMAKE_SIZEOF_VOID_P EQUAL 8))
+
if (_DEBUG)
set(CMAKE_BUILD_TYPE Debug)
endif (_DEBUG)
@@ -52,6 +68,10 @@ if (WIN32)
"Please use MSVC 1900 (included with Visual Studio 2015 or later).")
endif (${MSVC_VERSION} LESS 1900)
+ # COFF/PE and friends are somewhat limited in the number of sections they
+ # allow for an object file. We use this to avoid those problems.
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -DGOOGLE_GLOG_DLL_DECL= -DCURL_STATICLIB -D_SCL_SECURE_NO_WARNINGS /MP")
+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
elseif (COMPILER_SUPPORTS_CXX11)