diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index cfb26283a495e7..6110d3b855c8b2 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -220,12 +220,16 @@ Include="$(LibrariesNativeArtifactsPath)libSystem.Security.Cryptography.Native.Android.a" /> - + + $(LibrariesNativeArtifactsPath)libz.a; + $(LibrariesNativeArtifactsPath)libbrotlicommon.a; + $(LibrariesNativeArtifactsPath)libbrotlidec.a; + $(LibrariesNativeArtifactsPath)libbrotlienc.a" /> - + + diff --git a/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj b/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj index 7b4a3f052a5ebd..c529b8af3ebe91 100644 --- a/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj +++ b/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)-wasi true true diff --git a/src/libraries/System.IO.Compression/README.md b/src/libraries/System.IO.Compression/README.md index 2500774b8a6046..8f4eaa1ab6232b 100644 --- a/src/libraries/System.IO.Compression/README.md +++ b/src/libraries/System.IO.Compression/README.md @@ -7,7 +7,7 @@ Documentation can be found at https://learn.microsoft.com/dotnet/api/system.io.c [../../native/libs/System.IO.Compression.Native](../../native/libs/System.IO.Compression.Native) contains the PAL (Platform Abstraction Layer) of the zlib library used by System.IO.Compression. ## Zstandard support -Zstandard (zstd) compression and decompression is supported on all platforms except browser and WASI. The Zstandard source files are located in the `Zstandard` subdirectory. +Zstandard (zstd) compression and decompression is supported on all platforms except browser. The Zstandard source files are located in the `Zstandard` subdirectory. ### Dictionaries diff --git a/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs b/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs index 861397f787dcfb..4988b95ff92389 100644 --- a/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs +++ b/src/libraries/System.IO.Compression/ref/System.IO.Compression.cs @@ -286,7 +286,6 @@ public override void Write(System.ReadOnlySpan buffer) { } public override void WriteByte(byte value) { } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class ZstandardCompressionOptions { public ZstandardCompressionOptions() { } @@ -310,7 +309,6 @@ public ZstandardCompressionOptions() { } public int WindowLog2 { get { throw null; } set { } } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class ZstandardDecoder : System.IDisposable { public ZstandardDecoder() { } @@ -327,7 +325,6 @@ public void SetPrefix(System.ReadOnlyMemory prefix) { } public static bool TryGetMaxDecompressedLength(System.ReadOnlySpan data, out long length) { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class ZstandardDecompressionOptions { public ZstandardDecompressionOptions() { } @@ -335,7 +332,6 @@ public ZstandardDecompressionOptions() { } public int MaxWindowLog2 { get { throw null; } set { } } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class ZstandardDictionary : System.IDisposable { internal ZstandardDictionary() { } @@ -346,7 +342,6 @@ public void Dispose() { } public static byte[] Train(System.ReadOnlySpan samples, System.ReadOnlySpan sampleLengths, int maxDictionarySize) { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class ZstandardEncoder : System.IDisposable { public ZstandardEncoder() { } @@ -367,7 +362,6 @@ public void SetSourceLength(long length) { } public static bool TryCompress(System.ReadOnlySpan source, System.Span destination, out int bytesWritten, System.IO.Compression.ZstandardDictionary dictionary, int windowLog2) { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class ZstandardStream : System.IO.Stream { public ZstandardStream(System.IO.Stream stream, System.IO.Compression.CompressionLevel compressionLevel) { } diff --git a/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj b/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj index 6b25e05fc2d74e..322eabf8fcef7a 100644 --- a/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj +++ b/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj @@ -100,8 +100,8 @@ - - + + @@ -116,8 +116,8 @@ - - + + diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/Zstandard.PlatformNotSupported.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/Zstandard.PlatformNotSupported.cs index 756b7f42d54ac6..8a8e4c6065dbe4 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/Zstandard.PlatformNotSupported.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/Zstandard.PlatformNotSupported.cs @@ -6,7 +6,6 @@ namespace System.IO.Compression { [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardDecompressionOptions { public ZstandardDecompressionOptions() => throw new PlatformNotSupportedException(SR.PlatformNotSupported_ZstandardCompression); @@ -15,7 +14,6 @@ public sealed class ZstandardDecompressionOptions } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardCompressionOptions { public ZstandardCompressionOptions() => throw new PlatformNotSupportedException(SR.PlatformNotSupported_ZstandardCompression); @@ -40,7 +38,6 @@ public sealed class ZstandardCompressionOptions } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardDecoder : IDisposable { public ZstandardDecoder() => throw new PlatformNotSupportedException(SR.PlatformNotSupported_ZstandardCompression); @@ -58,7 +55,6 @@ public void Dispose() { } } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardDictionary : IDisposable { internal ZstandardDictionary() { } @@ -70,7 +66,6 @@ public void Dispose() { } } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardEncoder : IDisposable { public ZstandardEncoder() => throw new PlatformNotSupportedException(SR.PlatformNotSupported_ZstandardCompression); @@ -92,7 +87,6 @@ public void Dispose() { } } [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed partial class ZstandardStream : Stream { public ZstandardStream(Stream stream, CompressionLevel compressionLevel) : base() => throw new PlatformNotSupportedException(SR.PlatformNotSupported_ZstandardCompression); diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardCompressionOptions.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardCompressionOptions.cs index 18b831f16254c8..152971a39b21dc 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardCompressionOptions.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardCompressionOptions.cs @@ -5,7 +5,6 @@ namespace System.IO.Compression { /// Provides compression options to be used with Zstandard compression. [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardCompressionOptions { /// Gets the default compression quality level. diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecoder.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecoder.cs index 8645cb3728dd63..bf2026fd87d49e 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecoder.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecoder.cs @@ -12,7 +12,6 @@ namespace System.IO.Compression { /// Provides methods and properties to decompress data using Zstandard decompression. [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardDecoder : IDisposable { private SafeZstdDecompressHandle _context; diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecompressionOptions.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecompressionOptions.cs index 20ca85904f2a61..a90a530026738a 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecompressionOptions.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDecompressionOptions.cs @@ -5,7 +5,6 @@ namespace System.IO.Compression { /// Provides decompression options to be used with Zstandard decompression. [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardDecompressionOptions { diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDictionary.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDictionary.cs index 0b2778c9a06523..6a40df8a513711 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDictionary.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardDictionary.cs @@ -11,7 +11,6 @@ namespace System.IO.Compression { /// Represents a Zstandard compression dictionary. [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardDictionary : IDisposable { private readonly SafeZstdCDictHandle _compressionDictionary; diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardEncoder.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardEncoder.cs index 3fcd145e01ce5d..84a2fee73f0a4c 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardEncoder.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardEncoder.cs @@ -11,7 +11,6 @@ namespace System.IO.Compression { /// Provides methods and properties to compress data using Zstandard compression. [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed class ZstandardEncoder : IDisposable { internal SafeZstdCompressHandle _context; diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.cs index dea54d729d3224..6c2338da9e1d67 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardStream.cs @@ -10,7 +10,6 @@ namespace System.IO.Compression { /// Provides methods and properties used to compress and decompress streams by using the Zstandard data format specification. [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")] public sealed partial class ZstandardStream : Stream { private const int DefaultInternalBufferSize = 65536; // 64KB default buffer diff --git a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj index e425efa75a8334..39f2473936721f 100644 --- a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj +++ b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj @@ -67,8 +67,8 @@ - - + + diff --git a/src/libraries/System.Net.Http/ref/System.Net.Http.cs b/src/libraries/System.Net.Http/ref/System.Net.Http.cs index 1d8cc8044d6a2d..4f8747719f1b7c 100644 --- a/src/libraries/System.Net.Http/ref/System.Net.Http.cs +++ b/src/libraries/System.Net.Http/ref/System.Net.Http.cs @@ -7,7 +7,6 @@ namespace System.Net.Http { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class BrotliCompressedContent : System.Net.Http.HttpContent { public BrotliCompressedContent(System.Net.Http.HttpContent content, System.IO.Compression.BrotliCompressionOptions compressionOptions) { } @@ -539,7 +538,6 @@ public StringContent(string content, System.Text.Encoding? encoding, string? med protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("wasi")] public sealed partial class ZstandardCompressedContent : System.Net.Http.HttpContent { public ZstandardCompressedContent(System.Net.Http.HttpContent content, System.IO.Compression.CompressionLevel compressionLevel = System.IO.Compression.CompressionLevel.Optimal) { } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/BrotliCompressedContent.cs b/src/libraries/System.Net.Http/src/System/Net/Http/BrotliCompressedContent.cs index 0ac4ea4df98899..1502097cd98ace 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/BrotliCompressedContent.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/BrotliCompressedContent.cs @@ -13,7 +13,6 @@ namespace System.Net.Http /// Provides HTTP content that compresses the inner content using the Brotli content coding. /// [UnsupportedOSPlatform("browser")] - [UnsupportedOSPlatform("wasi")] public sealed class BrotliCompressedContent : HttpContent { private const string Encoding = "br"; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/ZstandardCompressedContent.cs b/src/libraries/System.Net.Http/src/System/Net/Http/ZstandardCompressedContent.cs index 47f36bb5692fcc..46ce3c20c68dee 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/ZstandardCompressedContent.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/ZstandardCompressedContent.cs @@ -13,7 +13,6 @@ namespace System.Net.Http /// Provides HTTP content that compresses the inner content using the Zstandard content coding. /// [UnsupportedOSPlatform("browser")] - [UnsupportedOSPlatform("wasi")] public sealed class ZstandardCompressedContent : HttpContent { private const string Encoding = "zstd"; diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.NonBrowser.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.NonBrowser.cs index 4974075e2a035a..1cd7784a1d49c2 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.NonBrowser.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.NonBrowser.cs @@ -12,9 +12,9 @@ namespace System.Net.Http.Functional.Tests { - // Brotli and Zstandard rely on native libraries that are not available on browser/wasi, so both - // types are annotated [UnsupportedOSPlatform("browser"/"wasi")]. This file is excluded from those - // builds; the gzip tests and shared helpers live in CompressedContentTest.cs. + // Brotli and Zstandard rely on native libraries that are not available on browser, so both + // types are annotated [UnsupportedOSPlatform("browser")]. This file is excluded from that + // build; the gzip tests and shared helpers live in CompressedContentTest.cs. public partial class CompressedContentTest { [Fact] diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.cs index b829dd216f940a..363e8f1f967704 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/CompressedContentTest.cs @@ -13,8 +13,8 @@ namespace System.Net.Http.Functional.Tests { // GZip is supported on every platform (including browser/wasi), so the gzip tests and the shared // helpers live in this file, which is compiled for all targets. Brotli and Zstandard are not - // supported on browser/wasi; their tests live in CompressedContentTest.NonBrowser.cs, which is - // excluded from those builds. + // supported on browser; their tests live in CompressedContentTest.NonBrowser.cs, which is + // excluded from that build. public partial class CompressedContentTest { [Fact] diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj index 6d287c4254e675..d0322b02802672 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj @@ -148,7 +148,7 @@ - + <_WasiHostLibsPost Include="$(WasiCoreCLRNativeRuntimeDir)libminipal.a" /> <_WasiHostLibsPost Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libz.a" /> - <_WasiHostLibsPost Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libzstd.a" Condition="Exists('$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libzstd.a')" /> + <_WasiHostLibsPost Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libzstd.a" /> + + <_WasiHostLibsPost Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libbrotlienc.a" /> + <_WasiHostLibsPost Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libbrotlidec.a" /> + <_WasiHostLibsPost Include="$(MicrosoftNetCoreAppRuntimePackRidNativeDir)libbrotlicommon.a" /> diff --git a/src/mono/wasi/runtime/CMakeLists.txt b/src/mono/wasi/runtime/CMakeLists.txt index 0277544d21c652..90248ccd6193e2 100644 --- a/src/mono/wasi/runtime/CMakeLists.txt +++ b/src/mono/wasi/runtime/CMakeLists.txt @@ -31,6 +31,10 @@ target_link_libraries(dotnet ${NATIVE_BIN_DIR}/libicuuc.a ${NATIVE_BIN_DIR}/libicui18n.a ${NATIVE_BIN_DIR}/libz.a + ${NATIVE_BIN_DIR}/libzstd.a + ${NATIVE_BIN_DIR}/libbrotlienc.a + ${NATIVE_BIN_DIR}/libbrotlidec.a + ${NATIVE_BIN_DIR}/libbrotlicommon.a ) set_target_properties(dotnet PROPERTIES diff --git a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt index d3a1132b5faf6c..e940783abaebae 100644 --- a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt +++ b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt @@ -6,7 +6,10 @@ if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB) include(${CLR_SRC_NATIVE_DIR}/external/zlib-ng.cmake) endif() -if(NOT CLR_CMAKE_TARGET_ARCH_WASM) +# Brotli is excluded on browser to keep the download size down (the browser has its own Brotli +# support). WASI apps relink the native runtime with a P/Invoke table generated from the app's +# trimmed assemblies, so Brotli is only linked into apps that use it. +if(NOT CLR_CMAKE_TARGET_BROWSER) if (CLR_CMAKE_USE_SYSTEM_BROTLI) find_library(BROTLIDEC brotlidec REQUIRED) find_library(BROTLIENC brotlienc REQUIRED) @@ -127,7 +130,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) ${NATIVE_LIBS_EXTRA} ) - if (NOT CLR_CMAKE_TARGET_ARCH_WASM) + if (NOT CLR_CMAKE_TARGET_BROWSER) target_include_directories(System.IO.Compression.Native-Static PUBLIC ${BROTLI_INCLUDE_DIRS}) target_link_libraries(System.IO.Compression.Native-Static PUBLIC ${BROTLI_LIBRARIES}) diff --git a/src/native/libs/System.IO.Compression.Native/entrypoints.c b/src/native/libs/System.IO.Compression.Native/entrypoints.c index 4b72f5d3c0fb35..c325b76e29f63c 100644 --- a/src/native/libs/System.IO.Compression.Native/entrypoints.c +++ b/src/native/libs/System.IO.Compression.Native/entrypoints.c @@ -6,7 +6,7 @@ // Include System.IO.Compression.Native headers #include "pal_zlib.h" -#if !defined(TARGET_WASM) +#if !defined(TARGET_BROWSER) #include #include #include @@ -15,11 +15,11 @@ #define ZSTD_STATIC_LINKING_ONLY #include #include -#endif // !TARGET_WASM +#endif // !TARGET_BROWSER static const Entry s_compressionNative[] = { -#if !defined(TARGET_WASM) +#if !defined(TARGET_BROWSER) DllImportEntry(BrotliDecoderCreateInstance) DllImportEntry(BrotliDecoderDecompress) DllImportEntry(BrotliDecoderDecompressStream) @@ -32,7 +32,7 @@ static const Entry s_compressionNative[] = DllImportEntry(BrotliEncoderHasMoreOutput) DllImportEntry(BrotliEncoderMaxCompressedSize) DllImportEntry(BrotliEncoderSetParameter) -#endif // !TARGET_WASM +#endif // !TARGET_BROWSER DllImportEntry(CompressionNative_Crc32) DllImportEntry(CompressionNative_Deflate) DllImportEntry(CompressionNative_DeflateEnd) @@ -43,7 +43,7 @@ static const Entry s_compressionNative[] = DllImportEntry(CompressionNative_InflateInit2_) DllImportEntry(CompressionNative_InflateReset2_) DllImportEntry(CompressionNative_CompressBound) -#if !defined(TARGET_WASM) +#if !defined(TARGET_BROWSER) DllImportEntry(ZSTD_createCCtx) DllImportEntry(ZSTD_createDCtx) DllImportEntry(ZSTD_freeCCtx) @@ -76,7 +76,7 @@ static const Entry s_compressionNative[] = DllImportEntry(ZSTD_CCtx_refPrefix) DllImportEntry(ZSTD_CCtx_setPledgedSrcSize) DllImportEntry(ZDICT_trainFromBuffer) -#endif // !TARGET_WASM +#endif // !TARGET_BROWSER }; EXTERN_C const void* CompressionResolveDllImport(const char* name); diff --git a/src/native/libs/System.IO.Compression.Native/extra_libs.cmake b/src/native/libs/System.IO.Compression.Native/extra_libs.cmake index 88bcf56414ab7d..8f178c00f20286 100644 --- a/src/native/libs/System.IO.Compression.Native/extra_libs.cmake +++ b/src/native/libs/System.IO.Compression.Native/extra_libs.cmake @@ -20,7 +20,7 @@ macro(append_extra_compression_libs NativeLibsExtra) endif () list(APPEND ${NativeLibsExtra} ${ZLIB_LIBRARIES}) - if (CLR_CMAKE_USE_SYSTEM_BROTLI AND NOT CLR_CMAKE_TARGET_ARCH_WASM) + if (CLR_CMAKE_USE_SYSTEM_BROTLI AND NOT CLR_CMAKE_TARGET_BROWSER) find_library(BROTLIDEC brotlidec REQUIRED) find_library(BROTLIENC brotlienc REQUIRED)