-
Notifications
You must be signed in to change notification settings - Fork 5k
Put brotli on the FetchContent plan (Try 2) #109707
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
88b2cf0
Reapply "Put brotli on the FetchContent plan (#107166)" (#109108)
jkoritzinsky 97c0d26
Don't double-install the brotli libs
jkoritzinsky dc47509
Don't try looking up locations for system brotli. Rely on the distro …
jkoritzinsky fd394f7
Install brotli where we install the compression native lib so they're…
jkoritzinsky 4afff60
Brotli should get pulled from the same place as Compression.Native
jkoritzinsky e3748a0
Fix looking for libbrotlicommon.a on disk to determine if we should u…
jkoritzinsky bd14e02
Merge branch 'main' of https://github.com/dotnet/runtime into brotli-…
jkoritzinsky 39f21ee
Merge branch 'main' into brotli-fetchcontent-v2
jkoritzinsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
1.1.0 | ||
https://github.com/google/brotli/releases/tag/v1.1.0 | ||
|
||
Copy the c/dec, c/enc, c/common, and c/include folders into the root and remove all other files. | ||
|
||
Apply https://github.com/google/brotli/commit/85d88cbfc2b742e0742286ec277b73bdbf7be433.patch | ||
Deleted tests, python, docs folders | ||
Apply https://github.com/google/brotli/commit/85d88cbfc2b742e0742286ec277b73bdbf7be433.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,32 @@ | ||
# IMPORTANT: do not use add_compile_options(), add_definitions() or similar functions here since it will leak to the including projects | ||
|
||
include_directories(BEFORE "${CMAKE_CURRENT_LIST_DIR}/brotli/include") | ||
include(FetchContent) | ||
|
||
set (BROTLI_SOURCES_BASE | ||
common/constants.c | ||
common/context.c | ||
common/dictionary.c | ||
common/platform.c | ||
common/shared_dictionary.c | ||
common/transform.c | ||
dec/bit_reader.c | ||
dec/decode.c | ||
dec/huffman.c | ||
dec/state.c | ||
enc/backward_references.c | ||
enc/backward_references_hq.c | ||
enc/bit_cost.c | ||
enc/block_splitter.c | ||
enc/brotli_bit_stream.c | ||
enc/cluster.c | ||
enc/command.c | ||
enc/compound_dictionary.c | ||
enc/compress_fragment.c | ||
enc/compress_fragment_two_pass.c | ||
enc/dictionary_hash.c | ||
enc/encode.c | ||
enc/encoder_dict.c | ||
enc/entropy_encode.c | ||
enc/fast_log.c | ||
enc/histogram.c | ||
enc/literal_cost.c | ||
enc/memory.c | ||
enc/metablock.c | ||
enc/static_dict.c | ||
enc/utf8_util.c | ||
FetchContent_Declare( | ||
brotli | ||
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/brotli | ||
) | ||
|
||
addprefix(BROTLI_SOURCES "${CMAKE_CURRENT_LIST_DIR}/brotli" "${BROTLI_SOURCES_BASE}") | ||
set(BROTLI_DISABLE_TESTS ON) | ||
set(__CURRENT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) | ||
set(BUILD_SHARED_LIBS OFF) | ||
FetchContent_MakeAvailable(brotli) | ||
set(BUILD_SHARED_LIBS ${__CURRENT_BUILD_SHARED_LIBS}) | ||
|
||
target_compile_options(brotlicommon PRIVATE $<$<COMPILE_LANG_AND_ID:C,MSVC>:/guard:cf>) | ||
target_compile_options(brotlienc PRIVATE $<$<COMPILE_LANG_AND_ID:C,MSVC>:/guard:cf>) | ||
target_compile_options(brotlidec PRIVATE $<$<COMPILE_LANG_AND_ID:C,MSVC>:/guard:cf>) | ||
target_compile_options(brotlienc PRIVATE $<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang,GNU>:-Wno-implicit-fallthrough>) | ||
target_compile_options(brotlidec PRIVATE $<$<COMPILE_LANG_AND_ID:C,Clang,AppleClang,GNU>:-Wno-implicit-fallthrough>) | ||
|
||
# Even though we aren't building brotli as shared libraries, we still need to be able to export the symbols | ||
# from the brotli libraries so that they can be used by System.IO.Compression. | ||
# Since we link all of the static libraries into a single shared library, we need to define BROTLICOMMON_SHARED_COMPILATION | ||
# for all targets so brotlienc and brotlidec don't expect to link against a separate brotlicommon shared library. | ||
target_compile_definitions(brotlienc PRIVATE BROTLI_SHARED_COMPILATION BROTLIENC_SHARED_COMPILATION BROTLICOMMON_SHARED_COMPILATION) | ||
target_compile_definitions(brotlidec PRIVATE BROTLI_SHARED_COMPILATION BROTLIDEC_SHARED_COMPILATION BROTLICOMMON_SHARED_COMPILATION) | ||
target_compile_definitions(brotlicommon PRIVATE BROTLI_SHARED_COMPILATION BROTLICOMMON_SHARED_COMPILATION) | ||
|
||
# Don't build the brotli command line tool unless explicitly requested | ||
# (which we never do) | ||
set_target_properties(brotli PROPERTIES EXCLUDE_FROM_ALL ON) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.