Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/mono/cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include(CheckTypeSize)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CheckCCompilerFlag)
include(CheckCSourceCompiles)

# Apple platforms like macOS/iOS allow targeting older operating system versions with a single SDK,
# the mere presence of a symbol in the SDK doesn't tell us whether the deployment target really supports it.
Expand Down Expand Up @@ -79,6 +80,21 @@ ac_check_funcs (
gethrtime read_real_time gethostbyname gethostbyname2 getnameinfo getifaddrs
access inet_ntop Qp2getifaddrs)

check_c_source_compiles(
"
#include <zlib.h>
int main(void)
{
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
#else
#error No good zlib found
#endif
return 0;
Comment on lines +88 to +92
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
"
HAVE_SYS_ZLIB)


if(NOT HOST_DARWIN)
# getentropy was introduced in macOS 10.12 / iOS 10.0
ac_check_funcs (getentropy)
Expand Down
1 change: 0 additions & 1 deletion src/mono/cmake/defines-todo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#option (NEED_LINK_UNLINK "Define if Unix sockets cannot be created in an anonymous namespace")
#option (HAVE_CLASSIC_WINAPI_SUPPORT "Use classic Windows API support")
#option (HAVE_UWP_WINAPI_SUPPORT "Don't use UWP Windows API support")
#option (HAVE_SYS_ZLIB "Use OS-provided zlib")
#option (MONO_XEN_OPT "Xen-specific behaviour")
#option (MONO_SMALL_CONFIG "Reduce runtime requirements (and capabilities)")
#option (AC_APPLE_UNIVERSAL_BUILD "Define if building universal (internal helper macro)")
Expand Down
10 changes: 6 additions & 4 deletions src/mono/mono/mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ include(../eglib/CMakeLists.txt)
include(../utils/CMakeLists.txt)
include(../metadata/CMakeLists.txt)
include(../sgen/CMakeLists.txt)
if(INTERNAL_ZLIB) # TODO: hook up HAVE_SYS_ZLIB instead
if(INTERNAL_ZLIB)
include(../zlib/CMakeLists.txt)
elseif(HAVE_SYS_ZLIB)
set(Z_LIBS z)
endif()
include(../component/CMakeLists.txt)

Expand Down Expand Up @@ -354,7 +356,7 @@ if(NOT DISABLE_SHARED_LIBS)
# to avoid a conflict we rename the import library with the .import.lib suffix
set_target_properties(monosgen-shared PROPERTIES IMPORT_SUFFIX ".import.lib")
endif()
target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS})
target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS})
if(ICU_LDFLAGS)
set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}")
endif()
Expand Down Expand Up @@ -404,7 +406,7 @@ if(NOT DISABLE_SHARED_LIBS)
add_library(${frameworkconfig} SHARED $<TARGET_OBJECTS:monosgen-objects>)
target_compile_definitions(${frameworkconfig} PRIVATE -DMONO_DLL_EXPORT)
target_sources(${frameworkconfig} PRIVATE $<TARGET_OBJECTS:eglib_objects>)
target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS})
target_link_libraries(${frameworkconfig} PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS})
if(ICU_LDFLAGS)
set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}")
endif()
Expand Down Expand Up @@ -478,7 +480,7 @@ if(NOT DISABLE_EXECUTABLES)
if(MONO_CROSS_COMPILE_EXECUTABLE_NAME)
set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross)
endif()
target_link_libraries(mono-sgen PRIVATE monosgen-static ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS})
target_link_libraries(mono-sgen PRIVATE monosgen-static ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS})
if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS)
# if components are built statically, link them into runtime.
target_sources(mono-sgen PRIVATE "${mono-components-objects}")
Expand Down
4 changes: 4 additions & 0 deletions src/mono/mono/profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ if(NOT DISABLE_LIBS)
add_library(mono-profiler-log-static STATIC helper.c log.c log-args.c)
set_target_properties(mono-profiler-log-static PROPERTIES OUTPUT_NAME mono-profiler-log)
install(TARGETS mono-profiler-log-static LIBRARY)

if(HAVE_SYS_ZLIB)
target_link_libraries(mono-profiler-log z)
endif()
endif()

add_library(mono-profiler-aot-static STATIC aot.c helper.c)
Expand Down