Skip to content

Commit

Permalink
[wasm] Remove USE_ZLIB=1 and include the sources instead (dotnet#64907)
Browse files Browse the repository at this point in the history
  • Loading branch information
akoeplinger authored Feb 11, 2022
1 parent 826c3d7 commit a5a0004
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/libraries/Native/AnyOS/zlib/pal_zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

#ifdef _WIN32
#define c_static_assert(e) static_assert((e),"")
#endif

#if defined(_WIN32) || defined(__EMSCRIPTEN__)
#include "../../Windows/System.IO.Compression.Native/zlib/zlib.h"
#else
#include "pal_utilities.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
project(System.IO.Compression.Native C)

if (CLR_CMAKE_TARGET_BROWSER)
add_definitions(-s USE_ZLIB)
endif()

include(${CMAKE_CURRENT_LIST_DIR}/extra_libs.cmake)

set(NATIVE_LIBS_EXTRA)
Expand All @@ -13,7 +9,21 @@ set(NATIVECOMPRESSION_SOURCES
../../AnyOS/zlib/pal_zlib.c
)

if (NOT CLR_CMAKE_TARGET_BROWSER)
if (CLR_CMAKE_TARGET_BROWSER)
set (NATIVECOMPRESSION_SOURCES
${NATIVECOMPRESSION_SOURCES}
../../Windows/System.IO.Compression.Native/zlib/adler32.c
../../Windows/System.IO.Compression.Native/zlib/compress.c
../../Windows/System.IO.Compression.Native/zlib/crc32.c
../../Windows/System.IO.Compression.Native/zlib/deflate.c
../../Windows/System.IO.Compression.Native/zlib/inffast.c
../../Windows/System.IO.Compression.Native/zlib/inflate.c
../../Windows/System.IO.Compression.Native/zlib/inftrees.c
../../Windows/System.IO.Compression.Native/zlib/trees.c
../../Windows/System.IO.Compression.Native/zlib/zutil.c
)
set_source_files_properties(${NATIVECOMPRESSION_SOURCES} PROPERTIES COMPILE_FLAGS -Wno-implicit-fallthrough)
else()
#Include Brotli include files
include_directories("../../AnyOS/brotli/include")

Expand Down
1 change: 0 additions & 1 deletion src/mono/wasm/wasm.proj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<_EmccFlags Include="@(_EmccCommonFlags)" />
<_EmccFlags Include="-s USE_ZLIB=1" />
</ItemGroup>

<WriteLinesToFile File="$(_EmccDefaultsRspPath)"
Expand Down

0 comments on commit a5a0004

Please sign in to comment.