You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2018/03/19 20:20:43 UTC

[5/9] mesos git commit: Windows: Switched to default CRT linkage.

Windows: Switched to default CRT linkage.

We previously attempted to manually override the CRT to be static
everywhere. Not only did this emit warnings, it was also error-prone
and unnecessary. We can, and should, just use the defaults, which is
`/MDd` in debug mode (multi-threaded, dynamic, debug linkage). Linking
to the CRT dynamically results in smaller libraries and executables,
reduces linking time, and avoids bugs when sharing allocated memory
across modules.

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


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

Branch: refs/heads/master
Commit: b9abc386ec64e99ddc4a2f8791b9f0cf0674669c
Parents: 6613e6a
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Mar 8 15:49:20 2018 -0800
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Mon Mar 19 12:34:57 2018 -0700

----------------------------------------------------------------------
 cmake/CompilationConfigure.cmake | 26 --------------------------
 1 file changed, 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b9abc386/cmake/CompilationConfigure.cmake
----------------------------------------------------------------------
diff --git a/cmake/CompilationConfigure.cmake b/cmake/CompilationConfigure.cmake
index 7419024..64cc56e 100644
--- a/cmake/CompilationConfigure.cmake
+++ b/cmake/CompilationConfigure.cmake
@@ -316,14 +316,7 @@ if (WIN32)
   # Build against the multi-threaded version of the C runtime library (CRT).
   if (BUILD_SHARED_LIBS)
     message(WARNING "Building with shared libraries is a work-in-progress.")
-
     set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
-
-    # Use dynamic CRT.
-    set(CRT " /MD")
-  else ()
-    # Use static CRT.
-    set(CRT " /MT")
   endif ()
 
   if (ENABLE_SSL)
@@ -338,25 +331,6 @@ if (WIN32)
   # Force use of Unicode C and C++ Windows APIs.
   add_definitions(-DUNICODE -D_UNICODE)
 
-  # NOTE: We APPEND ${CRT} rather than REPLACE so it gets picked up by
-  # dependencies.
-  foreach (lang C CXX)
-    # Debug library for debug configuration, release otherwise.
-
-    # Handle single-configuration generators such as Ninja.
-    if (CMAKE_BUILD_TYPE MATCHES Debug)
-      string(APPEND CMAKE_${lang}_FLAGS "${CRT}d")
-    else ()
-      string(APPEND CMAKE_${lang}_FLAGS ${CRT})
-    endif ()
-
-    # Handle multi-configuration generators such as Visual Studio.
-    string(APPEND CMAKE_${lang}_FLAGS_DEBUG "${CRT}d")
-    foreach (config RELEASE RELWITHDEBINFO MINSIZEREL)
-      string(APPEND CMAKE_${lang}_FLAGS_${config} ${CRT})
-    endforeach ()
-  endforeach ()
-
   # Convenience flags to simplify Windows support in C++ source; used to
   # `#ifdef` out some platform-specific parts of Mesos.  We choose to define
   # a new flag rather than using an existing flag (`_WIN32`) because we want