Skip to content
Permalink
Browse files
Merge pull request #6639 from lioncash/zlib
CMakeLists: Link zlib in privately where applicable, and don't dump its includes into the top-level directory
  • Loading branch information
leoetlino committed Apr 13, 2018
2 parents 9d70097 + 2851c7e commit b84806e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
@@ -572,11 +572,9 @@ endif()
find_package(ZLIB)
if(ZLIB_FOUND)
message(STATUS "Using shared zlib")
include_directories(${ZLIB_INCLUDE_DIRS})
else()
message(STATUS "Shared zlib not found, falling back to the static library")
add_subdirectory(Externals/zlib)
include_directories(Externals/zlib)
endif()

if(NOT APPLE)
@@ -77,3 +77,9 @@ set(ZLIB_SRCS
)

add_library(z STATIC ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
add_library(ZLIB::ZLIB ALIAS z)

target_include_directories(z
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
@@ -288,11 +288,11 @@ PUBLIC
videonull
videoogl
videosoftware
z

PRIVATE
bdisasm
${LZO}
ZLIB::ZLIB
)

if (APPLE)
@@ -21,3 +21,8 @@ add_library(discio
WiiSaveBanner.cpp
WiiWad.cpp
)

target_link_libraries(discio
PRIVATE
ZLIB::ZLIB
)

0 comments on commit b84806e

Please sign in to comment.