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/06/15 21:17:50 UTC

mesos git commit: Windows: Fixed libarchive and zlib linkage warnings.

Repository: mesos
Updated Branches:
  refs/heads/master 57091affe -> 7b4d625f7


Windows: Fixed libarchive and zlib linkage warnings.

Our build of libarchive was erroneously linking in the shared version
of our build of zlib, and so defined `ZLIB_DLL`, which caused warnings
when the consumers of libarchive also linked in the static version of
zlib. Instead, we can direct libarchive to use exactly the zlib
library the rest of the build is using.

Also forwarded the C arguments to libarchive for consistency with the
rest of our dependencies.

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


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

Branch: refs/heads/master
Commit: 7b4d625f722f2f5f503ab2d88c79fb3c55709f11
Parents: 57091af
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Thu Jun 14 16:04:44 2018 -0700
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Fri Jun 15 14:05:31 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/7b4d625f/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index 3c1dfcc..367df4b 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -934,6 +934,7 @@ if (WIN32 OR REBUNDLED)
 
   set(LIBARCHIVE_CMAKE_ARGS
     ${CMAKE_FORWARD_ARGS}
+    ${CMAKE_C_FORWARD_ARGS}
     -DENABLE_ACL=OFF
     -DENABLE_CNG=OFF
     -DENABLE_CPIO=OFF
@@ -959,10 +960,19 @@ if (WIN32 OR REBUNDLED)
     set_target_properties(
       libarchive PROPERTIES
       INTERFACE_COMPILE_DEFINITIONS LIBARCHIVE_STATIC
+      # NOTE: The install step avoids the need for separate DEBUG and
+      # RELEASE paths.
       IMPORTED_LOCATION ${LIBARCHIVE_ROOT}-build/lib/archive_static${LIBRARY_SUFFIX}
       INTERFACE_INCLUDE_DIRECTORIES ${LIBARCHIVE_ROOT}-build/include
       INTERFACE_LINK_LIBRARIES "bzip2;xz;zlib")
     set(LIBARCHIVE_DEPENDS bzip2 xz zlib)
+
+    # Make libarchive link against the same zlib the rest of the build
+    # links to. This is necessary because the zlib project
+    # unconditionally builds both shared and static libraries, and we
+    # need to be consistent about which is linked.
+    list(APPEND LIBARCHIVE_CMAKE_ARGS
+      -DZLIB_LIBRARY=$<TARGET_FILE:zlib>)
   else ()
     list(APPEND LIBARCHIVE_CMAKE_ARGS
       -DENABLE_BZip2=OFF