-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Static linking of native libs #44505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1c0b32b
4adfaa6
0facc65
a2ab07c
2b2f800
8c4e514
6e584b4
ba71464
4563d69
51281d6
25369f4
e6fca93
c11612f
d3f4abe
79453c7
becda0e
932b5fe
3f5cea9
8d2b6b9
9b7476f
8a02254
f22e9fd
e539a1a
06dad00
ac026ba
eb62c4a
2f45a47
7b2bdef
7ab3211
7bf0a63
d3a15fa
6c55b68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,22 @@ | ||
| set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
VSadov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| set(GLOBALIZATION_NATIVE_DIR ${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Globalization.Native) | ||
|
|
||
| # Suppress exporting of the PAL APIs | ||
| add_definitions(-DPALEXPORT=EXTERN_C) | ||
|
|
||
| include_directories("${GLOBALIZATION_NATIVE_DIR}") | ||
| include_directories("${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/Common") | ||
| set(STATIC_LIBS_ONLY 1) | ||
|
|
||
| add_subdirectory(${GLOBALIZATION_NATIVE_DIR} System.Globalization.Native) | ||
| if(CLR_CMAKE_TARGET_WIN32) | ||
VSadov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| set(GLOBALIZATION_NATIVE_DIR ${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Globalization.Native) | ||
| set(COMPRESSION_NATIVE_DIR ${CLR_REPO_ROOT_DIR}/src/libraries/Native/Windows/clrcompression) | ||
|
|
||
| include_directories("${GLOBALIZATION_NATIVE_DIR}") | ||
| include_directories("${COMPRESSION_NATIVE_DIR}") | ||
|
|
||
| include_directories("${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/Common") | ||
|
|
||
| add_subdirectory(${COMPRESSION_NATIVE_DIR} clrcompression) | ||
VSadov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| add_subdirectory(${GLOBALIZATION_NATIVE_DIR} System.Globalization.Native) | ||
|
|
||
| else() | ||
| add_subdirectory(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix Native.Unix) | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ internal static partial class Libraries | |
| internal const string Wldap32 = "wldap32.dll"; | ||
| internal const string Ws2_32 = "ws2_32.dll"; | ||
| internal const string Wtsapi32 = "wtsapi32.dll"; | ||
| internal const string CompressionNative = "clrcompression.dll"; | ||
| internal const string CompressionNative = "clrcompression"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to rename this to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume you mean renaming the actual dll ? We can also easily embed it now, similar to System.Globalization, unless there are reasons we want it as a separate dll. |
||
| internal const string MsQuic = "msquic.dll"; | ||
| internal const string HostPolicy = "hostpolicy.dll"; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| // Include System.IO.Compression.Native headers | ||
| #include "../zlib/pal_zlib.h" | ||
| #include "../brotli/include/brotli/decode.h" | ||
| #include "../brotli/include/brotli/encode.h" | ||
| #include "../brotli/include/brotli/port.h" | ||
| #include "../brotli/include/brotli/types.h" | ||
|
|
||
| #define FCFuncStart(name) EXTERN_C const void* name[]; const void* name[] = { | ||
| #define FCFuncEnd() (void*)0x01 /* FCFuncFlag_EndOfArray */ }; | ||
|
|
||
| #define QCFuncElement(name,impl) \ | ||
| (void*)0x8 /* FCFuncFlag_QCall */, (void*)(impl), (void*)name, | ||
|
|
||
| FCFuncStart(gEmbedded_Brotli) | ||
| QCFuncElement("BrotliDecoderCreateInstance", BrotliDecoderCreateInstance) | ||
| QCFuncElement("BrotliDecoderDecompress", BrotliDecoderDecompress) | ||
| QCFuncElement("BrotliDecoderDecompressStream", BrotliDecoderDecompressStream) | ||
| QCFuncElement("BrotliDecoderDestroyInstance", BrotliDecoderDestroyInstance) | ||
| QCFuncElement("BrotliDecoderIsFinished", BrotliDecoderIsFinished) | ||
| QCFuncElement("BrotliEncoderCompress", BrotliEncoderCompress) | ||
| QCFuncElement("BrotliEncoderCompressStream", BrotliEncoderCompressStream) | ||
| QCFuncElement("BrotliEncoderCreateInstance", BrotliEncoderCreateInstance) | ||
| QCFuncElement("BrotliEncoderDestroyInstance", BrotliEncoderDestroyInstance) | ||
| QCFuncElement("BrotliEncoderHasMoreOutput", BrotliEncoderHasMoreOutput) | ||
| QCFuncElement("BrotliEncoderSetParameter", BrotliEncoderSetParameter) | ||
| FCFuncEnd() | ||
|
|
||
| FCFuncStart(gEmbedded_zlib) | ||
| QCFuncElement("crc32", CompressionNative_Crc32) | ||
| QCFuncElement("Deflate", CompressionNative_Deflate) | ||
| QCFuncElement("DeflateEnd", CompressionNative_DeflateEnd) | ||
| QCFuncElement("DeflateInit2_", CompressionNative_DeflateInit2_) | ||
| QCFuncElement("Inflate", CompressionNative_Inflate) | ||
| QCFuncElement("InflateEnd", CompressionNative_InflateEnd) | ||
| QCFuncElement("InflateInit2_", CompressionNative_InflateInit2_) | ||
| FCFuncEnd() | ||
|
|
Uh oh!
There was an error while loading. Please reload this page.