1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Description: Remove embedded zlib
Author: Matthias Klumpp <mak@debian.org>
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -129,9 +129,9 @@
elseif("${TARGET_SYSTEM}" MATCHES "Android")
set(C_SYSTEM_LIBS m c)
elseif("${TARGET_SYSTEM}" MATCHES "Linux")
- set(C_SYSTEM_LIBS m pthread rt dl)
+ set(C_SYSTEM_LIBS m pthread rt dl z)
else()
- set(C_SYSTEM_LIBS m pthread)
+ set(C_SYSTEM_LIBS m pthread z)
endif()
endif()
@@ -231,6 +231,13 @@
file(GLOB_RECURSE PHOBOS2_C ${PHOBOS2_DIR}/*.c)
# remove some obsolete zlib modules
list(REMOVE_ITEM PHOBOS2_C ${PHOBOS2_DIR}/etc/c/zlib/minigzip.c ${PHOBOS2_DIR}/etc/c/zlib/example.c)
+
+ # don't embed zlib
+ foreach(item ${PHOBOS2_C})
+ if(${item} MATCHES ".*/c/zlib/.*.c")
+ list(REMOVE_ITEM PHOBOS2_C ${item})
+ endif()
+ endforeach()
endif()
#
--- a/cmake/Modules/BuildDExecutable.cmake
+++ b/cmake/Modules/BuildDExecutable.cmake
@@ -29,6 +29,7 @@
set(dflags "${D_COMPILER_FLAGS} ${DFLAGS_BASE} ${compiler_args}")
if(UNIX)
separate_arguments(dflags UNIX_COMMAND "${dflags}")
+ set(linker_args "${linker_args}" "-lz")
else()
separate_arguments(dflags WINDOWS_COMMAND "${dflags}")
endif()
|