include(configure.cmake)
+add_subdirectory(System.IO.Compression.Native)
+
if (NOT CLR_CMAKE_PLATFORM_WASM)
- add_subdirectory(System.IO.Compression.Native)
add_subdirectory(System.IO.Ports.Native)
endif()
project(System.IO.Compression.Native C)
-find_package(ZLIB REQUIRED)
+if (CLR_CMAKE_PLATFORM_WASM)
+ add_definitions(-s USE_ZLIB)
+else ()
+ find_package(ZLIB REQUIRED)
+endif ()
set(NATIVECOMPRESSION_SOURCES
../../AnyOS/zlib/pal_zlib.c
../../AnyOS/brotli/enc/utf8_util.c
)
-add_library(System.IO.Compression.Native
- SHARED
- ${NATIVECOMPRESSION_SOURCES}
- ${VERSION_FILE_PATH}
-)
+if (GEN_SHARED_LIB)
+ add_library(System.IO.Compression.Native
+ SHARED
+ ${NATIVECOMPRESSION_SOURCES}
+ ${VERSION_FILE_PATH}
+ )
+
+ target_link_libraries(System.IO.Compression.Native
+ ${ZLIB_LIBRARIES}
+ )
+ install_library_and_symbols (System.IO.Compression.Native)
+endif ()
add_library(System.IO.Compression.Native-Static
STATIC
set_target_properties(System.IO.Compression.Native-Static PROPERTIES PREFIX "")
set_target_properties(System.IO.Compression.Native-Static PROPERTIES OUTPUT_NAME System.IO.Compression.Native CLEAN_DIRECT_OUTPUT 1)
-target_link_libraries(System.IO.Compression.Native
- ${ZLIB_LIBRARIES}
-)
-
-install_library_and_symbols (System.IO.Compression.Native)
install (TARGETS System.IO.Compression.Native-Static DESTINATION .)