You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tsfile.apache.org by co...@apache.org on 2026/08/18 08:50:04 UTC
(tsfile) branch develop updated: feat(cpp): refactor dependency sourcing and extend codec compatibility (#905)
This is an automated email from the ASF dual-hosted git repository.
ColinLeeo pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/develop by this push:
new d4c3c9469 feat(cpp): refactor dependency sourcing and extend codec compatibility (#905)
d4c3c9469 is described below
commit d4c3c94690cf9af819bc26bec7114a0de7900359
Author: Colin Lee <10...@users.noreply.github.com>
AuthorDate: Tue Aug 18 16:49:57 2026 +0800
feat(cpp): refactor dependency sourcing and extend codec compatibility (#905)
* fix(cpp): audit third-party dependency metadata
* feat(cpp): add dependency source selection framework
* feat(cpp): support system and bundled LZ4
* feat(cpp): migrate zlib dependency sourcing
* feat(cpp): migrate lzokay dependency sourcing
* feat(cpp): migrate Snappy dependency sourcing
* feat(cpp): migrate SIMDe dependency sourcing
* feat(cpp): migrate ANTLR4 dependency sourcing
* feat(cpp): migrate Zstandard dependency sourcing
* feat(cpp): migrate liblzma dependency sourcing
* feat(cpp): add Zstandard and LZMA2 compression
* feat(cpp): add CHIMP RLBE and CAMEL encoding
* test: add Java and C++ codec compatibility coverage
* build(cpp): upgrade bundled Snappy to 1.2.2
* ci(cpp): validate dependency source modes
* ci(cpp): make dependency builds deterministic
* fix(cpp): normalize ANTLR patch hashes on Windows
* fix(ci): address remote C++ workflow failures
* fix(cpp): resolve system ANTLR utf8cpp target
* fix(cpp): inherit generator in dependency tests
* fix(cpp): preserve legacy CMake compatibility
* fix(ci): tolerate wrapped CMake errors
---
.github/workflows/code-coverage.yml | 4 +-
.github/workflows/codeql.yml | 2 +-
.github/workflows/compatibility-test.yml | 222 +
.github/workflows/cpp-dependency-source.yml | 365 +
.github/workflows/cppcheck.yml | 1 +
.github/workflows/unit-test-cpp-msvc.yml | 2 +
.github/workflows/unit-test-cpp.yml | 7 +-
.github/workflows/wheels.yml | 3 +
LICENSE | 336 +-
NOTICE | 2 +-
cpp/CLAUDE.md | 16 +-
cpp/CMakeLists.txt | 103 +-
cpp/README.md | 148 +
cpp/build.sh | 24 +-
cpp/cmake/ANTLR4Dependency.cmake | 90 +
cpp/cmake/ANTLR4Patch.cmake | 146 +
cpp/cmake/ANTLR4Source.cmake | 211 +
cpp/cmake/CopyToDir.cmake | 7 +-
cpp/cmake/DependencySource.cmake | 91 +
cpp/cmake/FindLZ4.cmake | 72 +
cpp/cmake/LZ4Dependency.cmake | 41 +
cpp/cmake/LZ4Source.cmake | 159 +
cpp/cmake/LZOKAYDependency.cmake | 45 +
cpp/cmake/LZOKAYSource.cmake | 169 +
cpp/cmake/LibLZMADependency.cmake | 89 +
cpp/cmake/LibLZMASource.cmake | 177 +
cpp/cmake/SIMDeDependency.cmake | 120 +
cpp/cmake/SIMDeSource.cmake | 169 +
cpp/cmake/SnappyDependency.cmake | 44 +
cpp/cmake/SnappySource.cmake | 171 +
cpp/cmake/ZLIBDependency.cmake | 55 +
cpp/cmake/ZLIBSource.cmake | 163 +
cpp/cmake/ZSTDDependency.cmake | 57 +
cpp/cmake/ZSTDSource.cmake | 170 +
cpp/cmake/tests/ANTLR4DependencyTest.cmake | 167 +
cpp/cmake/tests/ANTLR4SourceFailureCase.cmake | 56 +
cpp/cmake/tests/DependencySourceFailureCase.cmake | 32 +
cpp/cmake/tests/DependencySourceTest.cmake | 85 +
cpp/cmake/tests/LZ4DependencyTest.cmake | 132 +
cpp/cmake/tests/LZ4SourceFailureCase.cmake | 40 +
cpp/cmake/tests/LZOKAYDependencyTest.cmake | 146 +
cpp/cmake/tests/LZOKAYSourceFailureCase.cmake | 41 +
cpp/cmake/tests/LibLZMADependencyTest.cmake | 150 +
cpp/cmake/tests/LibLZMASourceFailureCase.cmake | 40 +
cpp/cmake/tests/SIMDeDependencyTest.cmake | 129 +
cpp/cmake/tests/SIMDeSourceFailureCase.cmake | 40 +
cpp/cmake/tests/SnappyDependencyTest.cmake | 148 +
cpp/cmake/tests/SnappySourceFailureCase.cmake | 40 +
cpp/cmake/tests/TestGeneratorArguments.cmake | 32 +
cpp/cmake/tests/ZLIBDependencyTest.cmake | 130 +
cpp/cmake/tests/ZLIBSourceFailureCase.cmake | 41 +
cpp/cmake/tests/ZSTDDependencyTest.cmake | 149 +
cpp/cmake/tests/ZSTDSourceFailureCase.cmake | 40 +
.../tests/projects/ANTLR4Dependency/CMakeLists.txt | 50 +
.../tests/projects/LZ4Dependency/CMakeLists.txt | 37 +
.../tests/projects/LZOKAYDependency/CMakeLists.txt | 38 +
.../projects/LibLZMADependency/CMakeLists.txt | 38 +
.../tests/projects/SIMDeDependency/CMakeLists.txt | 39 +
.../tests/projects/SnappyDependency/CMakeLists.txt | 38 +
.../tests/projects/ZLIBDependency/CMakeLists.txt | 36 +
.../tests/projects/ZSTDDependency/CMakeLists.txt | 38 +
cpp/examples/CMakeLists.txt | 13 +-
cpp/patches/antlr4-4.9.3-msvc-compat.patch | 126 -
cpp/pom.xml | 15 +
cpp/src/CMakeLists.txt | 119 +-
cpp/src/common/db_common.h | 14 +-
cpp/src/common/global.cc | 17 +-
cpp/src/common/global.h | 41 +-
cpp/src/common/schema.h | 4 +-
cpp/src/compress/CMakeLists.txt | 12 +-
cpp/src/compress/compressor_factory.h | 23 +-
cpp/src/compress/lzma2_compressor.cc | 163 +
cpp/src/compress/lzma2_compressor.h | 54 +
cpp/src/compress/zstd_compressor.cc | 133 +
cpp/src/compress/zstd_compressor.h | 54 +
cpp/src/cwrapper/tsfile_cwrapper.h | 18 +-
cpp/src/encoding/bit_packing_utils.h | 183 +
cpp/src/encoding/camel_decoder.h | 352 +
cpp/src/encoding/camel_encoder.h | 444 +
cpp/src/encoding/chimp_decoder.h | 270 +
cpp/src/encoding/chimp_encoder.h | 314 +
cpp/src/encoding/decoder_factory.h | 44 +
cpp/src/encoding/encoder_factory.h | 47 +
cpp/src/encoding/rlbe_decoder.h | 239 +
cpp/src/encoding/rlbe_encoder.h | 269 +
cpp/test/CMakeLists.txt | 160 +-
cpp/test/common/tsfile_common_test.cc | 33 +
cpp/test/compress/lzma2_compressor_test.cc | 83 +
cpp/test/compress/zstd_compressor_test.cc | 83 +
cpp/test/cwrapper/cwrapper_test.cc | 31 +
cpp/test/encoding/camel_codec_test.cc | 123 +
cpp/test/encoding/chimp_codec_test.cc | 151 +
cpp/test/encoding/rlbe_codec_test.cc | 160 +
...odel_encoding_compression_compatibility_test.cc | 596 +
cpp/test/tools/command_e2e_test.cc | 10 +-
cpp/test/tools/output_format_test.cc | 5 +
cpp/third_party/CMakeLists.txt | 437 +-
cpp/third_party/README.md | 230 +
.../antlr4-cpp-runtime-4/CMakeLists.txt | 218 -
cpp/third_party/antlr4-cpp-runtime-4/LICENSE.txt | 52 -
cpp/third_party/antlr4-cpp-runtime-4/README.md | 72 -
cpp/third_party/antlr4-cpp-runtime-4/VERSION | 0
.../antlr4-cpp-runtime-4/cmake/Antlr4Package.md | 136 -
.../cmake/ExternalAntlr4Cpp.cmake | 158 -
.../antlr4-cpp-runtime-4/cmake/FindANTLR.cmake | 124 -
.../antlr4-cpp-runtime-4/cmake/README.md | 157 -
.../cmake/antlr4-generator.cmake.in | 181 -
.../cmake/antlr4-runtime.cmake.in | 10 -
.../antlr4-cpp-runtime-4/demo/CMakeLists.txt | 80 -
.../antlr4-cpp-runtime-4/demo/Linux/main.cpp | 38 -
.../demo/Mac/antlr4-cpp-demo/main.cpp | 38 -
.../demo/Mac/antlrcpp Tests/Info.plist | 24 -
.../demo/Mac/antlrcpp Tests/InputHandlingTests.mm | 172 -
.../demo/Mac/antlrcpp Tests/MiscClassTests.mm | 388 -
.../demo/Mac/antlrcpp Tests/antlrcpp_Tests.mm | 57 -
.../Mac/antlrcpp-demo.xcodeproj/project.pbxproj | 609 -
.../project.xcworkspace/contents.xcworkspacedata | 7 -
.../xcshareddata/IDEWorkspaceChecks.plist | 8 -
.../xcschemes/antlr4-cpp-demo.xcscheme | 102 -
.../xcshareddata/xcschemes/antlrcpp Tests.xcscheme | 56 -
.../antlr4-cpp-runtime-4/demo/Mac/build.sh | 43 -
.../antlr4-cpp-runtime-4/demo/README.md | 13 -
.../antlr4-cpp-runtime-4/demo/TLexer.g4 | 86 -
.../antlr4-cpp-runtime-4/demo/TParser.g4 | 119 -
.../antlr4-cpp-demo/antlr4-cpp-demo-vs2015.vcxproj | 362 -
.../antlr4-cpp-demo-vs2015.vcxproj.filters | 63 -
.../antlr4-cpp-demo/antlr4-cpp-demo.vcxproj | 349 -
.../antlr4-cpp-demo.vcxproj.filters | 63 -
.../demo/Windows/antlr4-cpp-demo/main.cpp | 41 -
.../demo/Windows/antlr4cpp-vs2013.sln | 58 -
.../demo/Windows/antlr4cpp-vs2015.sln | 58 -
.../antlr4-cpp-runtime-4/demo/generate.cmd | 13 -
.../antlr4-cpp-runtime-4/demo/generate.sh | 28 -
.../antlr4-cpp-runtime-4/deploy-macos.sh | 48 -
.../antlr4-cpp-runtime-4/deploy-source.sh | 14 -
.../antlr4-cpp-runtime-4/deploy-windows.cmd | 81 -
.../antlr4-cpp-runtime-4/runtime/CMakeLists.txt | 165 -
.../runtime/antlr4cpp-vs2013.vcxproj | 637 -
.../runtime/antlr4cpp-vs2013.vcxproj.filters | 984 -
.../runtime/antlr4cpp-vs2015.vcxproj | 652 -
.../runtime/antlr4cpp-vs2015.vcxproj.filters | 990 -
.../runtime/antlr4cpp-vs2017.vcxproj | 652 -
.../runtime/antlr4cpp-vs2017.vcxproj.filters | 990 -
.../runtime/antlr4cpp-vs2019.vcxproj | 660 -
.../runtime/antlr4cpp-vs2019.vcxproj.filters | 990 -
.../runtime/antlrcpp-ios/Info.plist | 26 -
.../runtime/antlrcpp-ios/antlrcpp_ios.h | 17 -
.../runtime/antlrcpp.xcodeproj/project.pbxproj | 3040 --
.../project.xcworkspace/contents.xcworkspacedata | 7 -
.../xcshareddata/IDEWorkspaceChecks.plist | 8 -
.../xcshareddata/xcschemes/antlr4.xcscheme | 76 -
.../xcshareddata/xcschemes/antlr4_ios.xcscheme | 76 -
.../xcshareddata/xcschemes/antlr4_static.xcscheme | 76 -
.../runtime/src/ANTLRErrorListener.cpp | 10 -
.../runtime/src/ANTLRErrorListener.h | 167 -
.../runtime/src/ANTLRErrorStrategy.cpp | 10 -
.../runtime/src/ANTLRErrorStrategy.h | 121 -
.../runtime/src/ANTLRFileStream.cpp | 29 -
.../runtime/src/ANTLRFileStream.h | 30 -
.../runtime/src/ANTLRInputStream.cpp | 169 -
.../runtime/src/ANTLRInputStream.h | 76 -
.../runtime/src/BailErrorStrategy.cpp | 61 -
.../runtime/src/BailErrorStrategy.h | 59 -
.../runtime/src/BaseErrorListener.cpp | 25 -
.../runtime/src/BaseErrorListener.h | 36 -
.../runtime/src/BufferedTokenStream.cpp | 414 -
.../runtime/src/BufferedTokenStream.h | 200 -
.../runtime/src/CharStream.cpp | 11 -
.../antlr4-cpp-runtime-4/runtime/src/CharStream.h | 37 -
.../runtime/src/CommonToken.cpp | 195 -
.../antlr4-cpp-runtime-4/runtime/src/CommonToken.h | 158 -
.../runtime/src/CommonTokenFactory.cpp | 39 -
.../runtime/src/CommonTokenFactory.h | 74 -
.../runtime/src/CommonTokenStream.cpp | 78 -
.../runtime/src/CommonTokenStream.h | 79 -
.../runtime/src/ConsoleErrorListener.cpp | 15 -
.../runtime/src/ConsoleErrorListener.h | 35 -
.../runtime/src/DefaultErrorStrategy.cpp | 333 -
.../runtime/src/DefaultErrorStrategy.h | 466 -
.../runtime/src/DiagnosticErrorListener.cpp | 84 -
.../runtime/src/DiagnosticErrorListener.h | 80 -
.../runtime/src/Exceptions.cpp | 64 -
.../antlr4-cpp-runtime-4/runtime/src/Exceptions.h | 99 -
.../runtime/src/FailedPredicateException.cpp | 51 -
.../runtime/src/FailedPredicateException.h | 32 -
.../runtime/src/InputMismatchException.cpp | 18 -
.../runtime/src/InputMismatchException.h | 24 -
.../antlr4-cpp-runtime-4/runtime/src/IntStream.cpp | 12 -
.../antlr4-cpp-runtime-4/runtime/src/IntStream.h | 224 -
.../runtime/src/InterpreterRuleContext.cpp | 19 -
.../runtime/src/InterpreterRuleContext.h | 45 -
.../antlr4-cpp-runtime-4/runtime/src/Lexer.cpp | 295 -
.../antlr4-cpp-runtime-4/runtime/src/Lexer.h | 209 -
.../runtime/src/LexerInterpreter.cpp | 75 -
.../runtime/src/LexerInterpreter.h | 52 -
.../runtime/src/LexerNoViableAltException.cpp | 36 -
.../runtime/src/LexerNoViableAltException.h | 31 -
.../runtime/src/ListTokenSource.cpp | 92 -
.../runtime/src/ListTokenSource.h | 88 -
.../runtime/src/NoViableAltException.cpp | 46 -
.../runtime/src/NoViableAltException.h | 42 -
.../antlr4-cpp-runtime-4/runtime/src/Parser.cpp | 648 -
.../antlr4-cpp-runtime-4/runtime/src/Parser.h | 467 -
.../runtime/src/ParserInterpreter.cpp | 306 -
.../runtime/src/ParserInterpreter.h | 179 -
.../runtime/src/ParserRuleContext.cpp | 141 -
.../runtime/src/ParserRuleContext.h | 147 -
.../runtime/src/ProxyErrorListener.cpp | 53 -
.../runtime/src/ProxyErrorListener.h | 38 -
.../runtime/src/RecognitionException.cpp | 66 -
.../runtime/src/RecognitionException.h | 98 -
.../runtime/src/Recognizer.cpp | 167 -
.../antlr4-cpp-runtime-4/runtime/src/Recognizer.h | 171 -
.../runtime/src/RuleContext.cpp | 143 -
.../antlr4-cpp-runtime-4/runtime/src/RuleContext.h | 137 -
.../runtime/src/RuleContextWithAltNum.cpp | 27 -
.../runtime/src/RuleContextWithAltNum.h | 32 -
.../runtime/src/RuntimeMetaData.cpp | 53 -
.../runtime/src/RuntimeMetaData.h | 155 -
.../antlr4-cpp-runtime-4/runtime/src/Token.cpp | 9 -
.../antlr4-cpp-runtime-4/runtime/src/Token.h | 124 -
.../runtime/src/TokenFactory.h | 30 -
.../runtime/src/TokenSource.cpp | 9 -
.../antlr4-cpp-runtime-4/runtime/src/TokenSource.h | 85 -
.../runtime/src/TokenStream.cpp | 11 -
.../antlr4-cpp-runtime-4/runtime/src/TokenStream.h | 137 -
.../runtime/src/TokenStreamRewriter.cpp | 425 -
.../runtime/src/TokenStreamRewriter.h | 300 -
.../runtime/src/UnbufferedCharStream.cpp | 211 -
.../runtime/src/UnbufferedCharStream.h | 123 -
.../runtime/src/UnbufferedTokenStream.cpp | 270 -
.../runtime/src/UnbufferedTokenStream.h | 115 -
.../runtime/src/Vocabulary.cpp | 98 -
.../antlr4-cpp-runtime-4/runtime/src/Vocabulary.h | 192 -
.../runtime/src/WritableToken.cpp | 9 -
.../runtime/src/WritableToken.h | 23 -
.../runtime/src/antlr4-common.h | 139 -
.../runtime/src/antlr4-runtime.h | 168 -
.../antlr4-cpp-runtime-4/runtime/src/atn/ATN.cpp | 209 -
.../antlr4-cpp-runtime-4/runtime/src/atn/ATN.h | 124 -
.../runtime/src/atn/ATNConfig.cpp | 111 -
.../runtime/src/atn/ATNConfig.h | 154 -
.../runtime/src/atn/ATNConfigSet.cpp | 228 -
.../runtime/src/atn/ATNConfigSet.h | 110 -
.../runtime/src/atn/ATNDeserializationOptions.cpp | 64 -
.../runtime/src/atn/ATNDeserializationOptions.h | 50 -
.../runtime/src/atn/ATNDeserializer.cpp | 756 -
.../runtime/src/atn/ATNDeserializer.h | 91 -
.../runtime/src/atn/ATNSerializer.cpp | 621 -
.../runtime/src/atn/ATNSerializer.h | 61 -
.../runtime/src/atn/ATNSimulator.cpp | 63 -
.../runtime/src/atn/ATNSimulator.h | 87 -
.../runtime/src/atn/ATNState.cpp | 72 -
.../runtime/src/atn/ATNState.h | 147 -
.../antlr4-cpp-runtime-4/runtime/src/atn/ATNType.h | 20 -
.../src/atn/AbstractPredicateTransition.cpp | 14 -
.../runtime/src/atn/AbstractPredicateTransition.h | 24 -
.../runtime/src/atn/ActionTransition.cpp | 33 -
.../runtime/src/atn/ActionTransition.h | 33 -
.../runtime/src/atn/AmbiguityInfo.cpp | 16 -
.../runtime/src/atn/AmbiguityInfo.h | 68 -
.../runtime/src/atn/ArrayPredictionContext.cpp | 82 -
.../runtime/src/atn/ArrayPredictionContext.h | 43 -
.../runtime/src/atn/AtomTransition.cpp | 31 -
.../runtime/src/atn/AtomTransition.h | 30 -
.../runtime/src/atn/BasicBlockStartState.cpp | 12 -
.../runtime/src/atn/BasicBlockStartState.h | 22 -
.../runtime/src/atn/BasicState.cpp | 12 -
.../runtime/src/atn/BasicState.h | 21 -
.../runtime/src/atn/BlockEndState.cpp | 15 -
.../runtime/src/atn/BlockEndState.h | 24 -
.../runtime/src/atn/BlockStartState.cpp | 9 -
.../runtime/src/atn/BlockStartState.h | 21 -
.../runtime/src/atn/ContextSensitivityInfo.cpp | 14 -
.../runtime/src/atn/ContextSensitivityInfo.h | 47 -
.../runtime/src/atn/DecisionEventInfo.cpp | 14 -
.../runtime/src/atn/DecisionEventInfo.h | 70 -
.../runtime/src/atn/DecisionInfo.cpp | 25 -
.../runtime/src/atn/DecisionInfo.h | 227 -
.../runtime/src/atn/DecisionState.cpp | 17 -
.../runtime/src/atn/DecisionState.h | 30 -
.../runtime/src/atn/EmptyPredictionContext.cpp | 35 -
.../runtime/src/atn/EmptyPredictionContext.h | 27 -
.../runtime/src/atn/EpsilonTransition.cpp | 35 -
.../runtime/src/atn/EpsilonTransition.h | 39 -
.../runtime/src/atn/ErrorInfo.cpp | 15 -
.../runtime/src/atn/ErrorInfo.h | 43 -
.../runtime/src/atn/LL1Analyzer.cpp | 156 -
.../runtime/src/atn/LL1Analyzer.h | 115 -
.../runtime/src/atn/LexerATNConfig.cpp | 84 -
.../runtime/src/atn/LexerATNConfig.h | 44 -
.../runtime/src/atn/LexerATNSimulator.cpp | 626 -
.../runtime/src/atn/LexerATNSimulator.h | 219 -
.../runtime/src/atn/LexerAction.cpp | 9 -
.../runtime/src/atn/LexerAction.h | 66 -
.../runtime/src/atn/LexerActionExecutor.cpp | 107 -
.../runtime/src/atn/LexerActionExecutor.h | 115 -
.../runtime/src/atn/LexerActionType.h | 55 -
.../runtime/src/atn/LexerChannelAction.cpp | 55 -
.../runtime/src/atn/LexerChannelAction.h | 63 -
.../runtime/src/atn/LexerCustomAction.cpp | 62 -
.../runtime/src/atn/LexerCustomAction.h | 87 -
.../runtime/src/atn/LexerIndexedCustomAction.cpp | 63 -
.../runtime/src/atn/LexerIndexedCustomAction.h | 82 -
.../runtime/src/atn/LexerModeAction.cpp | 56 -
.../runtime/src/atn/LexerModeAction.h | 61 -
.../runtime/src/atn/LexerMoreAction.cpp | 47 -
.../runtime/src/atn/LexerMoreAction.h | 57 -
.../runtime/src/atn/LexerPopModeAction.cpp | 47 -
.../runtime/src/atn/LexerPopModeAction.h | 57 -
.../runtime/src/atn/LexerPushModeAction.cpp | 56 -
.../runtime/src/atn/LexerPushModeAction.h | 61 -
.../runtime/src/atn/LexerSkipAction.cpp | 47 -
.../runtime/src/atn/LexerSkipAction.h | 55 -
.../runtime/src/atn/LexerTypeAction.cpp | 56 -
.../runtime/src/atn/LexerTypeAction.h | 55 -
.../runtime/src/atn/LookaheadEventInfo.cpp | 16 -
.../runtime/src/atn/LookaheadEventInfo.h | 42 -
.../runtime/src/atn/LoopEndState.cpp | 12 -
.../runtime/src/atn/LoopEndState.h | 22 -
.../antlr4-cpp-runtime-4/runtime/src/atn/Makefile | 67 -
.../runtime/src/atn/NotSetTransition.cpp | 27 -
.../runtime/src/atn/NotSetTransition.h | 25 -
.../runtime/src/atn/OrderedATNConfigSet.cpp | 12 -
.../runtime/src/atn/OrderedATNConfigSet.h | 20 -
.../runtime/src/atn/ParseInfo.cpp | 102 -
.../runtime/src/atn/ParseInfo.h | 102 -
.../runtime/src/atn/ParserATNSimulator.cpp | 1370 -
.../runtime/src/atn/ParserATNSimulator.h | 904 -
.../runtime/src/atn/PlusBlockStartState.cpp | 12 -
.../runtime/src/atn/PlusBlockStartState.h | 25 -
.../runtime/src/atn/PlusLoopbackState.cpp | 12 -
.../runtime/src/atn/PlusLoopbackState.h | 22 -
.../src/atn/PrecedencePredicateTransition.cpp | 32 -
.../src/atn/PrecedencePredicateTransition.h | 29 -
.../runtime/src/atn/PredicateEvalInfo.cpp | 17 -
.../runtime/src/atn/PredicateEvalInfo.h | 62 -
.../runtime/src/atn/PredicateTransition.cpp | 34 -
.../runtime/src/atn/PredicateTransition.h | 39 -
.../runtime/src/atn/PredictionContext.cpp | 662 -
.../runtime/src/atn/PredictionContext.h | 268 -
.../runtime/src/atn/PredictionMode.cpp | 201 -
.../runtime/src/atn/PredictionMode.h | 436 -
.../runtime/src/atn/ProfilingATNSimulator.cpp | 179 -
.../runtime/src/atn/ProfilingATNSimulator.h | 60 -
.../runtime/src/atn/RangeTransition.cpp | 30 -
.../runtime/src/atn/RangeTransition.h | 29 -
.../runtime/src/atn/RuleStartState.cpp | 16 -
.../runtime/src/atn/RuleStartState.h | 25 -
.../runtime/src/atn/RuleStopState.cpp | 12 -
.../runtime/src/atn/RuleStopState.h | 25 -
.../runtime/src/atn/RuleTransition.cpp | 37 -
.../runtime/src/atn/RuleTransition.h | 40 -
.../runtime/src/atn/SemanticContext.cpp | 377 -
.../runtime/src/atn/SemanticContext.h | 222 -
.../runtime/src/atn/SetTransition.cpp | 32 -
.../runtime/src/atn/SetTransition.h | 30 -
.../runtime/src/atn/SingletonPredictionContext.cpp | 81 -
.../runtime/src/atn/SingletonPredictionContext.h | 36 -
.../runtime/src/atn/StarBlockStartState.cpp | 12 -
.../runtime/src/atn/StarBlockStartState.h | 21 -
.../runtime/src/atn/StarLoopEntryState.cpp | 15 -
.../runtime/src/atn/StarLoopEntryState.h | 35 -
.../runtime/src/atn/StarLoopbackState.cpp | 19 -
.../runtime/src/atn/StarLoopbackState.h | 21 -
.../runtime/src/atn/TokensStartState.cpp | 12 -
.../runtime/src/atn/TokensStartState.h | 21 -
.../runtime/src/atn/Transition.cpp | 44 -
.../runtime/src/atn/Transition.h | 76 -
.../runtime/src/atn/WildcardTransition.cpp | 25 -
.../runtime/src/atn/WildcardTransition.h | 25 -
.../antlr4-cpp-runtime-4/runtime/src/dfa/DFA.cpp | 127 -
.../antlr4-cpp-runtime-4/runtime/src/dfa/DFA.h | 91 -
.../runtime/src/dfa/DFASerializer.cpp | 67 -
.../runtime/src/dfa/DFASerializer.h | 32 -
.../runtime/src/dfa/DFAState.cpp | 100 -
.../runtime/src/dfa/DFAState.h | 144 -
.../runtime/src/dfa/LexerDFASerializer.cpp | 20 -
.../runtime/src/dfa/LexerDFASerializer.h | 23 -
.../runtime/src/misc/InterpreterDataReader.cpp | 124 -
.../runtime/src/misc/InterpreterDataReader.h | 31 -
.../runtime/src/misc/Interval.cpp | 89 -
.../runtime/src/misc/Interval.h | 84 -
.../runtime/src/misc/IntervalSet.cpp | 521 -
.../runtime/src/misc/IntervalSet.h | 198 -
.../runtime/src/misc/MurmurHash.cpp | 134 -
.../runtime/src/misc/MurmurHash.h | 82 -
.../runtime/src/misc/Predicate.cpp | 4 -
.../runtime/src/misc/Predicate.h | 21 -
.../runtime/src/support/Any.cpp | 13 -
.../antlr4-cpp-runtime-4/runtime/src/support/Any.h | 180 -
.../runtime/src/support/Arrays.cpp | 43 -
.../runtime/src/support/Arrays.h | 110 -
.../runtime/src/support/BitSet.h | 76 -
.../runtime/src/support/CPPUtils.cpp | 245 -
.../runtime/src/support/CPPUtils.h | 82 -
.../runtime/src/support/Casts.h | 33 -
.../runtime/src/support/Declarations.h | 163 -
.../runtime/src/support/Guid.cpp | 270 -
.../runtime/src/support/Guid.h | 154 -
.../runtime/src/support/StringUtils.cpp | 46 -
.../runtime/src/support/StringUtils.h | 76 -
.../runtime/src/tree/AbstractParseTreeVisitor.h | 128 -
.../runtime/src/tree/ErrorNode.cpp | 9 -
.../runtime/src/tree/ErrorNode.h | 19 -
.../runtime/src/tree/ErrorNodeImpl.cpp | 23 -
.../runtime/src/tree/ErrorNodeImpl.h | 33 -
.../runtime/src/tree/IterativeParseTreeWalker.cpp | 71 -
.../runtime/src/tree/IterativeParseTreeWalker.h | 53 -
.../runtime/src/tree/ParseTree.cpp | 15 -
.../runtime/src/tree/ParseTree.h | 102 -
.../runtime/src/tree/ParseTreeListener.cpp | 9 -
.../runtime/src/tree/ParseTreeListener.h | 39 -
.../runtime/src/tree/ParseTreeProperty.h | 50 -
.../runtime/src/tree/ParseTreeVisitor.cpp | 9 -
.../runtime/src/tree/ParseTreeVisitor.h | 57 -
.../runtime/src/tree/ParseTreeWalker.cpp | 49 -
.../runtime/src/tree/ParseTreeWalker.h | 55 -
.../runtime/src/tree/TerminalNode.cpp | 9 -
.../runtime/src/tree/TerminalNode.h | 32 -
.../runtime/src/tree/TerminalNodeImpl.cpp | 57 -
.../runtime/src/tree/TerminalNodeImpl.h | 33 -
.../runtime/src/tree/Trees.cpp | 241 -
.../antlr4-cpp-runtime-4/runtime/src/tree/Trees.h | 78 -
.../runtime/src/tree/pattern/Chunk.cpp | 9 -
.../runtime/src/tree/pattern/Chunk.h | 44 -
.../runtime/src/tree/pattern/ParseTreeMatch.cpp | 69 -
.../runtime/src/tree/pattern/ParseTreeMatch.h | 132 -
.../runtime/src/tree/pattern/ParseTreePattern.cpp | 64 -
.../runtime/src/tree/pattern/ParseTreePattern.h | 105 -
.../src/tree/pattern/ParseTreePatternMatcher.cpp | 371 -
.../src/tree/pattern/ParseTreePatternMatcher.h | 185 -
.../runtime/src/tree/pattern/RuleTagToken.cpp | 77 -
.../runtime/src/tree/pattern/RuleTagToken.h | 117 -
.../runtime/src/tree/pattern/TagChunk.cpp | 39 -
.../runtime/src/tree/pattern/TagChunk.h | 86 -
.../runtime/src/tree/pattern/TextChunk.cpp | 28 -
.../runtime/src/tree/pattern/TextChunk.h | 51 -
.../runtime/src/tree/pattern/TokenTagToken.cpp | 36 -
.../runtime/src/tree/pattern/TokenTagToken.h | 80 -
.../runtime/src/tree/xpath/XPath.cpp | 154 -
.../runtime/src/tree/xpath/XPath.h | 86 -
.../runtime/src/tree/xpath/XPathElement.cpp | 31 -
.../runtime/src/tree/xpath/XPathElement.h | 40 -
.../runtime/src/tree/xpath/XPathLexer.cpp | 173 -
.../runtime/src/tree/xpath/XPathLexer.g4 | 64 -
.../runtime/src/tree/xpath/XPathLexer.h | 56 -
.../runtime/src/tree/xpath/XPathLexer.tokens | 12 -
.../src/tree/xpath/XPathLexerErrorListener.cpp | 13 -
.../src/tree/xpath/XPathLexerErrorListener.h | 22 -
.../src/tree/xpath/XPathRuleAnywhereElement.cpp | 20 -
.../src/tree/xpath/XPathRuleAnywhereElement.h | 27 -
.../runtime/src/tree/xpath/XPathRuleElement.cpp | 30 -
.../runtime/src/tree/xpath/XPathRuleElement.h | 26 -
.../src/tree/xpath/XPathTokenAnywhereElement.cpp | 20 -
.../src/tree/xpath/XPathTokenAnywhereElement.h | 25 -
.../runtime/src/tree/xpath/XPathTokenElement.cpp | 33 -
.../runtime/src/tree/xpath/XPathTokenElement.h | 26 -
.../tree/xpath/XPathWildcardAnywhereElement.cpp | 23 -
.../src/tree/xpath/XPathWildcardAnywhereElement.h | 23 -
.../src/tree/xpath/XPathWildcardElement.cpp | 24 -
.../runtime/src/tree/xpath/XPathWildcardElement.h | 23 -
cpp/third_party/google_snappy/AUTHORS | 1 -
cpp/third_party/google_snappy/CMakeLists.txt | 439 -
cpp/third_party/google_snappy/COPYING | 54 -
cpp/third_party/google_snappy/README.md | 165 -
.../google_snappy/cmake/SnappyConfig.cmake.in | 33 -
cpp/third_party/google_snappy/cmake/config.h.in | 69 -
cpp/third_party/google_snappy/snappy-internal.h | 424 -
cpp/third_party/google_snappy/snappy-sinksource.cc | 121 -
cpp/third_party/google_snappy/snappy-sinksource.h | 182 -
.../google_snappy/snappy-stubs-internal.cc | 42 -
.../google_snappy/snappy-stubs-internal.h | 531 -
.../google_snappy/snappy-stubs-public.h.in | 63 -
cpp/third_party/google_snappy/snappy.cc | 2650 --
cpp/third_party/google_snappy/snappy.h | 257 -
cpp/third_party/lz4/CMakeLists.txt | 3 -
cpp/third_party/lz4/lz4.c | 3162 --
cpp/third_party/lz4/lz4.h | 1000 -
cpp/third_party/lzokay/CMakeLists.txt | 3 -
cpp/third_party/lzokay/LICENSE | 22 -
cpp/third_party/lzokay/lzokay.cpp | 647 -
cpp/third_party/lzokay/lzokay.hpp | 79 -
.../simde-0.8.4-rc3/.all-contributorsrc | 789 -
cpp/third_party/simde-0.8.4-rc3/.appveyor.yml | 121 -
.../simde-0.8.4-rc3/.azure-pipelines.yml | 84 -
.../simde-0.8.4-rc3/.circleci/config.yml | 263 -
cpp/third_party/simde-0.8.4-rc3/.cirrus.yml | 24 -
cpp/third_party/simde-0.8.4-rc3/.dockerignore | 4 -
.../simde-0.8.4-rc3/.drone.star.disabled | 119 -
cpp/third_party/simde-0.8.4-rc3/.editorconfig | 18 -
.../.github/actionlint-matcher.json | 17 -
.../simde-0.8.4-rc3/.github/dependabot.yml | 11 -
.../.github/workflows/actionlint.yml | 14 -
.../simde-0.8.4-rc3/.github/workflows/ci.yml | 1057 -
.../simde-0.8.4-rc3/.github/workflows/cmake.yml | 39 -
.../.github/workflows/codeql-analysis.yml | 43 -
.../simde-0.8.4-rc3/.github/workflows/deploy.yml | 49 -
.../.github/workflows/gcc-snapshot.yml | 338 -
.../.github/workflows/ossar-analysis.yml | 45 -
.../.github/workflows/pr-cleanup.yml | 30 -
cpp/third_party/simde-0.8.4-rc3/.gitignore | 4 -
cpp/third_party/simde-0.8.4-rc3/.gitmodules | 3 -
cpp/third_party/simde-0.8.4-rc3/.mailmap | 11 -
cpp/third_party/simde-0.8.4-rc3/.no-test/README.md | 10 -
cpp/third_party/simde-0.8.4-rc3/.packit.yml | 30 -
cpp/third_party/simde-0.8.4-rc3/.packit/README.md | 45 -
cpp/third_party/simde-0.8.4-rc3/.packit/ci.sh | 215 -
cpp/third_party/simde-0.8.4-rc3/.packit/simde.spec | 81 -
.../simde-0.8.4-rc3/.semaphore/semaphore.yml | 55 -
cpp/third_party/simde-0.8.4-rc3/.travis.yml | 50 -
cpp/third_party/simde-0.8.4-rc3/CMakeLists.txt | 78 -
cpp/third_party/simde-0.8.4-rc3/CONTRIBUTING.md | 109 -
cpp/third_party/simde-0.8.4-rc3/COPYING | 20 -
cpp/third_party/simde-0.8.4-rc3/README.md | 521 -
cpp/third_party/simde-0.8.4-rc3/amalgamate.py | 59 -
cpp/third_party/simde-0.8.4-rc3/codecov.yml | 3 -
cpp/third_party/simde-0.8.4-rc3/docker/Dockerfile | 120 -
.../simde-0.8.4-rc3/docker/Dockerfile.ubuntu | 110 -
.../docker/Dockerfile.ubuntu_bionic | 110 -
cpp/third_party/simde-0.8.4-rc3/docker/README.md | 50 -
.../simde-0.8.4-rc3/docker/bin/arch2gcc.sh | 65 -
.../simde-0.8.4-rc3/docker/bin/simde-check-all.sh | 12 -
.../docker/bin/simde-reset-build.sh | 30 -
.../docker/cross-files/aarch64+sve-clang-10.cross | 20 -
.../docker/cross-files/aarch64+sve-clang-11.cross | 20 -
.../docker/cross-files/aarch64+sve-clang-12.cross | 20 -
.../docker/cross-files/aarch64+sve-clang-13.cross | 20 -
.../docker/cross-files/aarch64+sve-clang-14.cross | 20 -
.../docker/cross-files/aarch64+sve-clang-15.cross | 20 -
.../docker/cross-files/aarch64+sve-gcc-10.cross | 18 -
.../docker/cross-files/aarch64+sve-gcc-11.cross | 18 -
.../docker/cross-files/aarch64+sve-gcc-12.cross | 18 -
.../docker/cross-files/aarch64-clang-10.cross | 20 -
.../docker/cross-files/aarch64-clang-11.cross | 20 -
.../docker/cross-files/aarch64-clang-12.cross | 20 -
.../cross-files/aarch64-clang-13-debflags.cross | 20 -
.../docker/cross-files/aarch64-clang-13.cross | 20 -
.../cross-files/aarch64-clang-14-debflags.cross | 20 -
.../docker/cross-files/aarch64-clang-14.cross | 20 -
.../cross-files/aarch64-clang-15-ccache.cross | 20 -
.../cross-files/aarch64-clang-15-debflags.cross | 20 -
.../docker/cross-files/aarch64-clang-15.cross | 20 -
.../cross-files/aarch64-clang-16-ccache.cross | 20 -
.../cross-files/aarch64-clang-17-ccache.cross | 20 -
.../cross-files/aarch64-clang-18-ccache.cross | 20 -
.../aarch64-clang-18-no-extras-ccache.cross | 20 -
.../cross-files/aarch64-clang-19-ccache.cross | 21 -
.../aarch64-clang-19-no-extras-ccache.cross | 21 -
.../cross-files/aarch64-clang-20-ccache.cross | 21 -
.../aarch64-clang-20-no-extras-ccache.cross | 21 -
.../cross-files/aarch64-clang-21-ccache.cross | 21 -
.../aarch64-clang-21-no-extras-ccache.cross | 21 -
.../cross-files/aarch64-clang-22-ccache.cross | 21 -
.../aarch64-clang-22-no-extras-ccache.cross | 21 -
.../cross-files/aarch64-clang-23-ccache.cross | 21 -
.../aarch64-clang-23-no-extras-ccache.cross | 21 -
.../docker/cross-files/aarch64-clang-6.cross | 20 -
.../docker/cross-files/aarch64-clang-7.cross | 20 -
.../docker/cross-files/aarch64-clang-8.cross | 20 -
.../docker/cross-files/aarch64-clang-9.cross | 20 -
.../docker/cross-files/aarch64-gcc-10.cross | 18 -
.../docker/cross-files/aarch64-gcc-11-ccache.cross | 18 -
.../cross-files/aarch64-gcc-11-debflags.cross | 20 -
.../docker/cross-files/aarch64-gcc-11.cross | 18 -
.../docker/cross-files/aarch64-gcc-12-ccache.cross | 18 -
.../cross-files/aarch64-gcc-12-debflags.cross | 20 -
.../docker/cross-files/aarch64-gcc-12.cross | 18 -
.../docker/cross-files/aarch64-gcc-13-ccache.cross | 18 -
.../docker/cross-files/aarch64-gcc-14-ccache.cross | 18 -
.../aarch64-gcc-14-no-extras-ccache.cross | 18 -
.../docker/cross-files/aarch64-gcc-15-ccache.cross | 18 -
.../aarch64-gcc-15-no-extras-ccache.cross | 18 -
.../docker/cross-files/aarch64-gcc-16-ccache.cross | 18 -
.../aarch64-gcc-16-no-extras-ccache.cross | 18 -
.../docker/cross-files/aarch64-gcc-7.cross | 18 -
.../docker/cross-files/aarch64-gcc-8.cross | 18 -
.../docker/cross-files/aarch64-gcc-9.cross | 18 -
.../docker/cross-files/armel-clang-15-ccache.cross | 20 -
.../docker/cross-files/armel-clang-16-ccache.cross | 20 -
.../docker/cross-files/armel-clang-17-ccache.cross | 20 -
.../docker/cross-files/armel-clang-18-ccache.cross | 20 -
.../docker/cross-files/armel-clang-19-ccache.cross | 21 -
.../docker/cross-files/armel-clang-20-ccache.cross | 21 -
.../docker/cross-files/armel-clang-21-ccache.cross | 21 -
.../docker/cross-files/armel-clang-22-ccache.cross | 21 -
.../docker/cross-files/armel-clang-23-ccache.cross | 21 -
.../docker/cross-files/armel-gcc-11-debflags.cross | 20 -
.../docker/cross-files/armel-gcc-12-ccache.cross | 18 -
.../docker/cross-files/armel-gcc-12-debflags.cross | 20 -
.../docker/cross-files/armel-gcc-13-ccache.cross | 18 -
.../docker/cross-files/armel-gcc-14-ccache.cross | 18 -
.../docker/cross-files/armel-gcc-15-ccache.cross | 18 -
.../docker/cross-files/armel-gcc-16-ccache.cross | 18 -
.../docker/cross-files/armhf-gcc-11-debflags.cross | 20 -
.../docker/cross-files/armhf-gcc-12-debflags.cross | 20 -
.../docker/cross-files/armv7-clang-11.cross | 20 -
.../docker/cross-files/armv7-clang-12.cross | 20 -
.../docker/cross-files/armv7-clang-13.cross | 20 -
.../docker/cross-files/armv7-clang-14.cross | 20 -
.../docker/cross-files/armv7-clang-15-ccache.cross | 20 -
.../docker/cross-files/armv7-clang-15.cross | 20 -
.../docker/cross-files/armv7-clang-16-ccache.cross | 20 -
.../docker/cross-files/armv7-clang-17-ccache.cross | 20 -
.../docker/cross-files/armv7-clang-18-ccache.cross | 20 -
.../docker/cross-files/armv7-clang-19-ccache.cross | 21 -
.../docker/cross-files/armv7-clang-20-ccache.cross | 21 -
.../docker/cross-files/armv7-clang-21-ccache.cross | 21 -
.../docker/cross-files/armv7-clang-22-ccache.cross | 21 -
.../docker/cross-files/armv7-clang-23-ccache.cross | 21 -
.../docker/cross-files/armv7-clang-6.cross | 20 -
.../docker/cross-files/armv7-gcc-10.cross | 18 -
.../docker/cross-files/armv7-gcc-11.cross | 18 -
.../docker/cross-files/armv7-gcc-12-ccache.cross | 18 -
.../docker/cross-files/armv7-gcc-12.cross | 18 -
.../docker/cross-files/armv7-gcc-13-ccache.cross | 18 -
.../docker/cross-files/armv7-gcc-14-ccache.cross | 18 -
.../docker/cross-files/armv7-gcc-15-ccache.cross | 18 -
.../docker/cross-files/armv7-gcc-16-ccache.cross | 18 -
.../docker/cross-files/armv7-gcc-8.cross | 18 -
.../docker/cross-files/armv8+mve-gcc-10.cross | 18 -
.../docker/cross-files/armv8+mve-gcc-11.cross | 18 -
.../docker/cross-files/armv8+mve-gcc-12.cross | 18 -
.../docker/cross-files/armv8-clang-10.cross | 20 -
.../docker/cross-files/armv8-clang-11.cross | 20 -
.../docker/cross-files/armv8-clang-12.cross | 20 -
.../docker/cross-files/armv8-clang-13.cross | 20 -
.../docker/cross-files/armv8-clang-14.cross | 20 -
.../docker/cross-files/armv8-clang-15.cross | 20 -
.../docker/cross-files/armv8-clang-6.cross | 20 -
.../docker/cross-files/armv8-clang-8.cross | 20 -
.../docker/cross-files/armv8-clang-9.cross | 20 -
.../docker/cross-files/armv8-gcc-10.cross | 18 -
.../docker/cross-files/armv8-gcc-11.cross | 18 -
.../cross-files/armv8-gcc-12-32bit-ccache.cross | 18 -
.../docker/cross-files/armv8-gcc-12.cross | 18 -
.../cross-files/armv8-gcc-13-32bit-ccache.cross | 18 -
.../cross-files/armv8-gcc-14-32bit-ccache.cross | 18 -
.../cross-files/armv8-gcc-15-32bit-ccache.cross | 18 -
.../cross-files/armv8-gcc-16-32bit-ccache.cross | 18 -
.../docker/cross-files/armv8-gcc-9.cross | 18 -
.../docker/cross-files/clang-10.cross | 11 -
.../docker/cross-files/clang-11-debflags.cross | 11 -
.../docker/cross-files/clang-11.cross | 11 -
.../docker/cross-files/clang-12.cross | 11 -
.../docker/cross-files/clang-13.cross | 11 -
.../docker/cross-files/clang-14.cross | 11 -
.../docker/cross-files/clang-15.cross | 11 -
.../docker/cross-files/clang-16.cross | 11 -
.../docker/cross-files/clang-17.cross | 11 -
.../docker/cross-files/clang-3.9.cross | 11 -
.../docker/cross-files/clang-4.cross | 11 -
.../docker/cross-files/clang-5.cross | 11 -
.../docker/cross-files/clang-6.cross | 11 -
.../docker/cross-files/clang-7.cross | 11 -
.../docker/cross-files/clang-8.cross | 11 -
.../docker/cross-files/clang-9.cross | 11 -
.../docker/cross-files/emscripten32-relaxed.cross | 22 -
.../docker/cross-files/emscripten32.cross | 22 -
.../docker/cross-files/emscripten64-relaxed.cross | 26 -
.../docker/cross-files/emscripten64.cross | 26 -
.../docker/cross-files/gcc-10-fast-math.cross | 11 -
.../docker/cross-files/gcc-10.cross | 11 -
.../docker/cross-files/gcc-11-debflags.cross | 13 -
.../docker/cross-files/gcc-11-fast-math.cross | 11 -
.../docker/cross-files/gcc-11.cross | 11 -
.../docker/cross-files/gcc-12-debflags.cross | 13 -
.../docker/cross-files/gcc-12-fast-math.cross | 11 -
.../docker/cross-files/gcc-12-native.cross | 11 -
.../docker/cross-files/gcc-12.cross | 11 -
.../simde-0.8.4-rc3/docker/cross-files/gcc-5.cross | 11 -
.../simde-0.8.4-rc3/docker/cross-files/gcc-6.cross | 11 -
.../simde-0.8.4-rc3/docker/cross-files/gcc-7.cross | 11 -
.../simde-0.8.4-rc3/docker/cross-files/gcc-8.cross | 11 -
.../simde-0.8.4-rc3/docker/cross-files/gcc-9.cross | 11 -
.../docker/cross-files/i686-all-gcc-10.cross | 18 -
.../docker/cross-files/i686-all-gcc-11.cross | 18 -
.../docker/cross-files/i686-all-gcc-12.cross | 18 -
.../docker/cross-files/i686-all-gcc-9.cross | 18 -
.../docker/cross-files/i686-clang-10.cross | 19 -
.../docker/cross-files/i686-clang-11.cross | 19 -
.../docker/cross-files/i686-clang-12.cross | 19 -
.../docker/cross-files/i686-clang-13.cross | 19 -
.../docker/cross-files/i686-clang-14.cross | 19 -
.../docker/cross-files/i686-clang-15.cross | 19 -
.../docker/cross-files/i686-gcc-10-debflags.cross | 19 -
.../docker/cross-files/i686-gcc-10.cross | 17 -
.../docker/cross-files/i686-gcc-11-debflags.cross | 19 -
.../cross-files/i686-gcc-11-qemu-ccache.cross | 21 -
.../docker/cross-files/i686-gcc-11-qemu.cross | 21 -
.../docker/cross-files/i686-gcc-11.cross | 20 -
.../docker/cross-files/i686-gcc-12-debflags.cross | 19 -
.../cross-files/i686-gcc-12-qemu-ccache.cross | 21 -
.../docker/cross-files/i686-gcc-12.cross | 17 -
.../docker/cross-files/i686-gcc-14.cross | 17 -
.../docker/cross-files/i686-gcc-9.cross | 17 -
.../docker/cross-files/i686-gcc-qemu-ccache.cross | 21 -
.../docker/cross-files/i686-gcc-qemu.cross | 21 -
.../simde-0.8.4-rc3/docker/cross-files/icc.cross | 13 -
.../simde-0.8.4-rc3/docker/cross-files/icx.cross | 11 -
.../docker/cross-files/intel-all-clang-10.cross | 21 -
.../docker/cross-files/intel-all-clang-11.cross | 18 -
.../docker/cross-files/intel-all-clang-12.cross | 18 -
.../docker/cross-files/intel-all-clang-13.cross | 18 -
.../docker/cross-files/intel-all-clang-14.cross | 18 -
.../docker/cross-files/intel-all-clang-15.cross | 18 -
.../docker/cross-files/intel-all-clang-7.cross | 18 -
.../docker/cross-files/intel-all-clang-8.cross | 18 -
.../docker/cross-files/intel-all-clang-9.cross | 21 -
.../docker/cross-files/intel-all-gcc-10.cross | 18 -
.../docker/cross-files/intel-all-gcc-11.cross | 18 -
.../docker/cross-files/intel-all-gcc-12.cross | 18 -
.../docker/cross-files/intel-all-gcc-8.cross | 18 -
.../docker/cross-files/intel-all-icc.cross | 20 -
.../docker/cross-files/intel-all-icx.cross | 18 -
.../cross-files/loongarch64-clang-18-ccache.cross | 20 -
.../cross-files/loongarch64-clang-19-ccache.cross | 21 -
.../cross-files/loongarch64-clang-20-ccache.cross | 21 -
.../cross-files/loongarch64-clang-21-ccache.cross | 21 -
.../cross-files/loongarch64-clang-22-ccache.cross | 21 -
.../cross-files/loongarch64-clang-23-ccache.cross | 21 -
.../cross-files/loongarch64-gcc-13-ccache.cross | 18 -
.../docker/cross-files/loongarch64-gcc-13.cross | 18 -
.../cross-files/loongarch64-gcc-14-ccache.cross | 20 -
.../cross-files/loongarch64-gcc-15-ccache.cross | 20 -
.../cross-files/loongarch64-gcc-16-ccache.cross | 20 -
.../docker/cross-files/loongson-gcc-10.cross | 18 -
.../docker/cross-files/loongson-gcc-11.cross | 18 -
.../docker/cross-files/loongson-gcc-12.cross | 18 -
.../docker/cross-files/loongson-gcc-ccache.cross | 18 -
.../docker/cross-files/loongson-gcc.cross | 18 -
.../docker/cross-files/mips64el+msa-gcc-10.cross | 18 -
.../docker/cross-files/mips64el+msa-gcc-11.cross | 18 -
.../docker/cross-files/mips64el+msa-gcc-12.cross | 18 -
.../docker/cross-files/mips64el-clang-11.cross | 20 -
.../docker/cross-files/mips64el-clang-12.cross | 20 -
.../docker/cross-files/mips64el-clang-13.cross | 20 -
.../docker/cross-files/mips64el-clang-14.cross | 20 -
.../docker/cross-files/mips64el-clang-15.cross | 20 -
.../cross-files/mips64el-clang-16-ccache.cross | 20 -
.../docker/cross-files/mips64el-clang-16.cross | 20 -
.../cross-files/mips64el-clang-17-ccache.cross | 20 -
.../cross-files/mips64el-clang-18-ccache.cross | 20 -
.../docker/cross-files/mips64el-gcc-10.cross | 18 -
.../docker/cross-files/mips64el-gcc-11.cross | 18 -
.../cross-files/mips64el-gcc-12-ccache.cross | 18 -
.../docker/cross-files/mips64el-gcc-12.cross | 18 -
.../cross-files/mips64el-gcc-13-ccache.cross | 18 -
.../cross-files/mips64el-gcc-14-ccache.cross | 18 -
.../cross-files/mips64el-gcc-15-ccache.cross | 18 -
.../cross-files/mips64el-gcc-16-ccache.cross | 18 -
.../docker/cross-files/power8-clang-9.cross | 20 -
.../docker/cross-files/power8-gcc-10.cross | 18 -
.../docker/cross-files/power9-clang-10.cross | 20 -
.../docker/cross-files/power9-clang-11.cross | 20 -
.../docker/cross-files/power9-clang-12.cross | 20 -
.../docker/cross-files/power9-clang-13.cross | 20 -
.../docker/cross-files/power9-clang-14.cross | 20 -
.../cross-files/power9-clang-15-ccache.cross | 20 -
.../docker/cross-files/power9-clang-15.cross | 20 -
.../docker/cross-files/power9-gcc-10.cross | 18 -
.../docker/cross-files/power9-gcc-11.cross | 18 -
.../docker/cross-files/power9-gcc-12-ccache.cross | 18 -
.../docker/cross-files/power9-gcc-12.cross | 18 -
.../docker/cross-files/power9-gcc-13-ccache.cross | 18 -
.../docker/cross-files/power9-gcc-14-ccache.cross | 18 -
.../docker/cross-files/power9-gcc-15-ccache.cross | 18 -
.../docker/cross-files/power9-gcc-16-ccache.cross | 18 -
.../docker/cross-files/ppc64el-clang-14.cross | 20 -
.../cross-files/ppc64el-clang-15-ccache.cross | 20 -
.../docker/cross-files/ppc64el-clang-15.cross | 20 -
.../cross-files/ppc64el-clang-16-ccache.cross | 20 -
.../cross-files/ppc64el-clang-17-ccache.cross | 20 -
.../cross-files/ppc64el-clang-18-ccache.cross | 20 -
.../cross-files/ppc64el-clang-19-ccache.cross | 21 -
.../cross-files/ppc64el-clang-20-ccache.cross | 21 -
.../cross-files/ppc64el-clang-21-ccache.cross | 21 -
.../cross-files/ppc64el-clang-22-ccache.cross | 21 -
.../cross-files/ppc64el-clang-23-ccache.cross | 21 -
.../cross-files/ppc64el-gcc-10-debflags.cross | 20 -
.../docker/cross-files/ppc64el-gcc-10.cross | 18 -
.../cross-files/ppc64el-gcc-11-debflags.cross | 20 -
.../docker/cross-files/ppc64el-gcc-11.cross | 18 -
.../cross-files/ppc64el-gcc-12-debflags.cross | 20 -
.../docker/cross-files/ppc64el-gcc-12.cross | 18 -
...iscv64+rvv_vlen128_elen64-clang-17-ccache.cross | 37 -
...iscv64+rvv_vlen128_elen64-clang-18-ccache.cross | 37 -
...4+rvv_vlen128_elen64_zvfh-clang-17-ccache.cross | 37 -
...4+rvv_vlen128_elen64_zvfh-clang-18-ccache.cross | 37 -
...iscv64+rvv_vlen256_elen64-clang-17-ccache.cross | 37 -
...iscv64+rvv_vlen256_elen64-clang-18-ccache.cross | 37 -
...4+rvv_vlen256_elen64_zvfh-clang-17-ccache.cross | 37 -
...4+rvv_vlen256_elen64_zvfh-clang-18-ccache.cross | 37 -
...iscv64+rvv_vlen512_elen64-clang-17-ccache.cross | 37 -
...iscv64+rvv_vlen512_elen64-clang-18-ccache.cross | 37 -
...4+rvv_vlen512_elen64_zvfh-clang-17-ccache.cross | 37 -
...4+rvv_vlen512_elen64_zvfh-clang-18-ccache.cross | 37 -
.../docker/cross-files/riscv64-clang-10.cross | 20 -
.../docker/cross-files/riscv64-clang-11.cross | 20 -
.../docker/cross-files/riscv64-clang-12.cross | 20 -
.../docker/cross-files/riscv64-clang-13.cross | 20 -
.../docker/cross-files/riscv64-clang-14.cross | 20 -
.../cross-files/riscv64-clang-15-ccache.cross | 20 -
.../docker/cross-files/riscv64-clang-15.cross | 20 -
.../cross-files/riscv64-clang-16-ccache.cross | 20 -
.../docker/cross-files/riscv64-clang-16.cross | 20 -
.../cross-files/riscv64-clang-17-ccache.cross | 20 -
.../docker/cross-files/riscv64-clang-17.cross | 20 -
.../cross-files/riscv64-clang-18-ccache.cross | 20 -
.../cross-files/riscv64-clang-19-ccache.cross | 21 -
.../cross-files/riscv64-clang-20-ccache.cross | 21 -
.../cross-files/riscv64-clang-21-ccache.cross | 21 -
.../cross-files/riscv64-clang-22-ccache.cross | 21 -
.../cross-files/riscv64-clang-23-ccache.cross | 21 -
.../docker/cross-files/riscv64-clang-9.cross | 20 -
.../docker/cross-files/riscv64-gcc-10.cross | 18 -
.../docker/cross-files/riscv64-gcc-11.cross | 18 -
.../cross-files/riscv64-gcc-12-O3-ccache.cross | 18 -
.../docker/cross-files/riscv64-gcc-12-ccache.cross | 18 -
.../docker/cross-files/riscv64-gcc-12.cross | 18 -
.../cross-files/riscv64-gcc-13-O3-ccache.cross | 18 -
.../docker/cross-files/riscv64-gcc-13-ccache.cross | 18 -
.../cross-files/riscv64-gcc-14-O3-ccache.cross | 18 -
.../docker/cross-files/riscv64-gcc-14-ccache.cross | 18 -
.../cross-files/riscv64-gcc-15-O3-ccache.cross | 18 -
.../docker/cross-files/riscv64-gcc-15-ccache.cross | 18 -
.../cross-files/riscv64-gcc-16-O3-ccache.cross | 18 -
.../docker/cross-files/riscv64-gcc-16-ccache.cross | 18 -
.../docker/cross-files/s390x-clang-11.cross | 20 -
.../docker/cross-files/s390x-clang-12.cross | 20 -
.../docker/cross-files/s390x-clang-13.cross | 20 -
.../docker/cross-files/s390x-clang-14.cross | 20 -
.../docker/cross-files/s390x-clang-15-ccache.cross | 20 -
.../docker/cross-files/s390x-clang-15.cross | 20 -
.../docker/cross-files/s390x-clang-16-ccache.cross | 20 -
.../docker/cross-files/s390x-clang-17-ccache.cross | 20 -
.../docker/cross-files/s390x-clang-18-ccache.cross | 20 -
.../docker/cross-files/s390x-clang-19-ccache.cross | 21 -
.../docker/cross-files/s390x-clang-20-ccache.cross | 21 -
.../docker/cross-files/s390x-clang-21-ccache.cross | 21 -
.../docker/cross-files/s390x-clang-22-ccache.cross | 21 -
.../docker/cross-files/s390x-clang-23-ccache.cross | 21 -
.../docker/cross-files/s390x-gcc-10.cross | 18 -
.../docker/cross-files/s390x-gcc-11-debflags.cross | 20 -
.../docker/cross-files/s390x-gcc-11.cross | 18 -
.../docker/cross-files/s390x-gcc-12-ccache.cross | 18 -
.../docker/cross-files/s390x-gcc-12-debflags.cross | 20 -
.../docker/cross-files/s390x-gcc-12.cross | 18 -
.../docker/cross-files/s390x-gcc-13-ccache.cross | 18 -
.../docker/cross-files/s390x-gcc-14-ccache.cross | 18 -
.../docker/cross-files/s390x-gcc-15-ccache.cross | 18 -
.../docker/cross-files/s390x-gcc-16-ccache.cross | 18 -
.../docker/cross-files/s390x-gcc-8.cross | 18 -
.../docker/cross-files/s390x-gcc-9.cross | 18 -
.../docker/cross-files/sleef-gcc-10.cross | 12 -
.../docker/cross-files/sleef-gcc-11.cross | 12 -
.../docker/cross-files/sleef-gcc-12.cross | 12 -
.../simde-0.8.4-rc3/docker/simde-dev.sh | 83 -
cpp/third_party/simde-0.8.4-rc3/meson.build | 566 -
cpp/third_party/simde-0.8.4-rc3/meson_options.txt | 9 -
.../simde-0.8.4-rc3/netlify-disable.toml | 38 -
cpp/third_party/simde-0.8.4-rc3/simde/arm/neon.h | 321 -
.../simde-0.8.4-rc3/simde/arm/neon/aba.h | 208 -
.../simde-0.8.4-rc3/simde/arm/neon/abal.h | 178 -
.../simde-0.8.4-rc3/simde/arm/neon/abal_high.h | 125 -
.../simde-0.8.4-rc3/simde/arm/neon/abd.h | 629 -
.../simde-0.8.4-rc3/simde/arm/neon/abdl.h | 147 -
.../simde-0.8.4-rc3/simde/arm/neon/abdl_high.h | 181 -
.../simde-0.8.4-rc3/simde/arm/neon/abs.h | 536 -
.../simde-0.8.4-rc3/simde/arm/neon/add.h | 975 -
.../simde-0.8.4-rc3/simde/arm/neon/addhn.h | 211 -
.../simde-0.8.4-rc3/simde/arm/neon/addhn_high.h | 124 -
.../simde-0.8.4-rc3/simde/arm/neon/addl.h | 170 -
.../simde-0.8.4-rc3/simde/arm/neon/addl_high.h | 182 -
.../simde-0.8.4-rc3/simde/arm/neon/addlv.h | 414 -
.../simde-0.8.4-rc3/simde/arm/neon/addv.h | 555 -
.../simde-0.8.4-rc3/simde/arm/neon/addw.h | 241 -
.../simde-0.8.4-rc3/simde/arm/neon/addw_high.h | 215 -
.../simde-0.8.4-rc3/simde/arm/neon/aes.h | 222 -
.../simde-0.8.4-rc3/simde/arm/neon/and.h | 584 -
.../simde-0.8.4-rc3/simde/arm/neon/bcax.h | 227 -
.../simde-0.8.4-rc3/simde/arm/neon/bic.h | 553 -
.../simde-0.8.4-rc3/simde/arm/neon/bsl.h | 914 -
.../simde-0.8.4-rc3/simde/arm/neon/cadd_rot270.h | 231 -
.../simde-0.8.4-rc3/simde/arm/neon/cadd_rot90.h | 231 -
.../simde-0.8.4-rc3/simde/arm/neon/cage.h | 192 -
.../simde-0.8.4-rc3/simde/arm/neon/cagt.h | 192 -
.../simde-0.8.4-rc3/simde/arm/neon/cale.h | 168 -
.../simde-0.8.4-rc3/simde/arm/neon/calt.h | 168 -
.../simde-0.8.4-rc3/simde/arm/neon/ceq.h | 872 -
.../simde-0.8.4-rc3/simde/arm/neon/ceqz.h | 481 -
.../simde-0.8.4-rc3/simde/arm/neon/cge.h | 909 -
.../simde-0.8.4-rc3/simde/arm/neon/cgez.h | 482 -
.../simde-0.8.4-rc3/simde/arm/neon/cgt.h | 905 -
.../simde-0.8.4-rc3/simde/arm/neon/cgtz.h | 484 -
.../simde-0.8.4-rc3/simde/arm/neon/cle.h | 935 -
.../simde-0.8.4-rc3/simde/arm/neon/clez.h | 545 -
.../simde-0.8.4-rc3/simde/arm/neon/cls.h | 148 -
.../simde-0.8.4-rc3/simde/arm/neon/clt.h | 913 -
.../simde-0.8.4-rc3/simde/arm/neon/cltz.h | 389 -
.../simde-0.8.4-rc3/simde/arm/neon/clz.h | 427 -
.../simde-0.8.4-rc3/simde/arm/neon/cmla.h | 223 -
.../simde-0.8.4-rc3/simde/arm/neon/cmla_lane.h | 386 -
.../simde-0.8.4-rc3/simde/arm/neon/cmla_rot180.h | 231 -
.../simde/arm/neon/cmla_rot180_lane.h | 422 -
.../simde-0.8.4-rc3/simde/arm/neon/cmla_rot270.h | 229 -
.../simde/arm/neon/cmla_rot270_lane.h | 421 -
.../simde-0.8.4-rc3/simde/arm/neon/cmla_rot90.h | 233 -
.../simde/arm/neon/cmla_rot90_lane.h | 420 -
.../simde-0.8.4-rc3/simde/arm/neon/cnt.h | 224 -
.../simde-0.8.4-rc3/simde/arm/neon/combine.h | 499 -
.../simde-0.8.4-rc3/simde/arm/neon/copy_lane.h | 1200 -
.../simde-0.8.4-rc3/simde/arm/neon/crc32.h | 295 -
.../simde-0.8.4-rc3/simde/arm/neon/create.h | 255 -
.../simde-0.8.4-rc3/simde/arm/neon/cvt.h | 2258 --
.../simde-0.8.4-rc3/simde/arm/neon/cvt_n.h | 703 -
.../simde-0.8.4-rc3/simde/arm/neon/cvtm.h | 389 -
.../simde-0.8.4-rc3/simde/arm/neon/cvtn.h | 538 -
.../simde-0.8.4-rc3/simde/arm/neon/cvtp.h | 387 -
.../simde-0.8.4-rc3/simde/arm/neon/div.h | 202 -
.../simde-0.8.4-rc3/simde/arm/neon/dot.h | 300 -
.../simde-0.8.4-rc3/simde/arm/neon/dot_lane.h | 753 -
.../simde-0.8.4-rc3/simde/arm/neon/dup_lane.h | 1715 -
.../simde-0.8.4-rc3/simde/arm/neon/dup_n.h | 905 -
.../simde-0.8.4-rc3/simde/arm/neon/eor.h | 844 -
.../simde-0.8.4-rc3/simde/arm/neon/ext.h | 1203 -
.../simde-0.8.4-rc3/simde/arm/neon/fma.h | 217 -
.../simde-0.8.4-rc3/simde/arm/neon/fma_lane.h | 335 -
.../simde-0.8.4-rc3/simde/arm/neon/fma_n.h | 132 -
.../simde-0.8.4-rc3/simde/arm/neon/fmlal.h | 557 -
.../simde-0.8.4-rc3/simde/arm/neon/fmlsl.h | 397 -
.../simde-0.8.4-rc3/simde/arm/neon/fms.h | 195 -
.../simde-0.8.4-rc3/simde/arm/neon/fms_lane.h | 334 -
.../simde-0.8.4-rc3/simde/arm/neon/fms_n.h | 174 -
.../simde-0.8.4-rc3/simde/arm/neon/get_high.h | 435 -
.../simde-0.8.4-rc3/simde/arm/neon/get_lane.h | 727 -
.../simde-0.8.4-rc3/simde/arm/neon/get_low.h | 470 -
.../simde-0.8.4-rc3/simde/arm/neon/hadd.h | 370 -
.../simde-0.8.4-rc3/simde/arm/neon/hsub.h | 371 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1.h | 713 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1_dup.h | 548 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1_lane.h | 527 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1_x2.h | 491 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1_x3.h | 514 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1_x4.h | 545 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1q_x2.h | 403 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1q_x3.h | 404 -
.../simde-0.8.4-rc3/simde/arm/neon/ld1q_x4.h | 406 -
.../simde-0.8.4-rc3/simde/arm/neon/ld2.h | 1382 -
.../simde-0.8.4-rc3/simde/arm/neon/ld2_dup.h | 620 -
.../simde-0.8.4-rc3/simde/arm/neon/ld2_lane.h | 642 -
.../simde-0.8.4-rc3/simde/arm/neon/ld3.h | 1117 -
.../simde-0.8.4-rc3/simde/arm/neon/ld3_dup.h | 616 -
.../simde-0.8.4-rc3/simde/arm/neon/ld3_lane.h | 642 -
.../simde-0.8.4-rc3/simde/arm/neon/ld4.h | 921 -
.../simde-0.8.4-rc3/simde/arm/neon/ld4_dup.h | 617 -
.../simde-0.8.4-rc3/simde/arm/neon/ld4_lane.h | 829 -
.../simde-0.8.4-rc3/simde/arm/neon/max.h | 851 -
.../simde-0.8.4-rc3/simde/arm/neon/maxnm.h | 301 -
.../simde-0.8.4-rc3/simde/arm/neon/maxnmv.h | 203 -
.../simde-0.8.4-rc3/simde/arm/neon/maxv.h | 467 -
.../simde-0.8.4-rc3/simde/arm/neon/min.h | 858 -
.../simde-0.8.4-rc3/simde/arm/neon/minnm.h | 303 -
.../simde-0.8.4-rc3/simde/arm/neon/minnmv.h | 224 -
.../simde-0.8.4-rc3/simde/arm/neon/minv.h | 491 -
.../simde-0.8.4-rc3/simde/arm/neon/mla.h | 427 -
.../simde-0.8.4-rc3/simde/arm/neon/mla_lane.h | 241 -
.../simde-0.8.4-rc3/simde/arm/neon/mla_n.h | 354 -
.../simde-0.8.4-rc3/simde/arm/neon/mlal.h | 211 -
.../simde-0.8.4-rc3/simde/arm/neon/mlal_high.h | 211 -
.../simde/arm/neon/mlal_high_lane.h | 147 -
.../simde-0.8.4-rc3/simde/arm/neon/mlal_high_n.h | 157 -
.../simde-0.8.4-rc3/simde/arm/neon/mlal_lane.h | 120 -
.../simde-0.8.4-rc3/simde/arm/neon/mlal_n.h | 156 -
.../simde-0.8.4-rc3/simde/arm/neon/mls.h | 405 -
.../simde-0.8.4-rc3/simde/arm/neon/mls_lane.h | 240 -
.../simde-0.8.4-rc3/simde/arm/neon/mls_n.h | 252 -
.../simde-0.8.4-rc3/simde/arm/neon/mlsl.h | 179 -
.../simde-0.8.4-rc3/simde/arm/neon/mlsl_high.h | 191 -
.../simde/arm/neon/mlsl_high_lane.h | 147 -
.../simde-0.8.4-rc3/simde/arm/neon/mlsl_high_n.h | 161 -
.../simde-0.8.4-rc3/simde/arm/neon/mlsl_lane.h | 120 -
.../simde-0.8.4-rc3/simde/arm/neon/mlsl_n.h | 125 -
.../simde-0.8.4-rc3/simde/arm/neon/mmlaq.h | 158 -
.../simde-0.8.4-rc3/simde/arm/neon/movl.h | 257 -
.../simde-0.8.4-rc3/simde/arm/neon/movl_high.h | 126 -
.../simde-0.8.4-rc3/simde/arm/neon/movn.h | 208 -
.../simde-0.8.4-rc3/simde/arm/neon/movn_high.h | 125 -
.../simde-0.8.4-rc3/simde/arm/neon/mul.h | 774 -
.../simde-0.8.4-rc3/simde/arm/neon/mul_lane.h | 928 -
.../simde-0.8.4-rc3/simde/arm/neon/mul_n.h | 239 -
.../simde-0.8.4-rc3/simde/arm/neon/mull.h | 293 -
.../simde-0.8.4-rc3/simde/arm/neon/mull_high.h | 178 -
.../simde/arm/neon/mull_high_lane.h | 170 -
.../simde-0.8.4-rc3/simde/arm/neon/mull_high_n.h | 98 -
.../simde-0.8.4-rc3/simde/arm/neon/mull_lane.h | 120 -
.../simde-0.8.4-rc3/simde/arm/neon/mull_n.h | 158 -
.../simde-0.8.4-rc3/simde/arm/neon/mulx.h | 237 -
.../simde-0.8.4-rc3/simde/arm/neon/mulx_lane.h | 455 -
.../simde-0.8.4-rc3/simde/arm/neon/mulx_n.h | 69 -
.../simde-0.8.4-rc3/simde/arm/neon/mvn.h | 497 -
.../simde-0.8.4-rc3/simde/arm/neon/neg.h | 474 -
.../simde-0.8.4-rc3/simde/arm/neon/orn.h | 505 -
.../simde-0.8.4-rc3/simde/arm/neon/orr.h | 552 -
.../simde-0.8.4-rc3/simde/arm/neon/padal.h | 211 -
.../simde-0.8.4-rc3/simde/arm/neon/padd.h | 417 -
.../simde-0.8.4-rc3/simde/arm/neon/paddl.h | 347 -
.../simde-0.8.4-rc3/simde/arm/neon/pmax.h | 312 -
.../simde-0.8.4-rc3/simde/arm/neon/pmaxnm.h | 142 -
.../simde-0.8.4-rc3/simde/arm/neon/pmin.h | 337 -
.../simde-0.8.4-rc3/simde/arm/neon/pminnm.h | 142 -
.../simde-0.8.4-rc3/simde/arm/neon/qabs.h | 314 -
.../simde-0.8.4-rc3/simde/arm/neon/qadd.h | 798 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlal.h | 98 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlal_high.h | 69 -
.../simde/arm/neon/qdmlal_high_lane.h | 82 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlal_high_n.h | 69 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlal_lane.h | 122 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlal_n.h | 69 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlsl.h | 98 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlsl_high.h | 70 -
.../simde/arm/neon/qdmlsl_high_lane.h | 82 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlsl_high_n.h | 70 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlsl_lane.h | 122 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmlsl_n.h | 69 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmulh.h | 176 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmulh_lane.h | 186 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmulh_n.h | 80 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmull.h | 170 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmull_high.h | 69 -
.../simde/arm/neon/qdmull_high_lane.h | 107 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmull_high_n.h | 70 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmull_lane.h | 206 -
.../simde-0.8.4-rc3/simde/arm/neon/qdmull_n.h | 69 -
.../simde-0.8.4-rc3/simde/arm/neon/qmovn.h | 273 -
.../simde-0.8.4-rc3/simde/arm/neon/qmovn_high.h | 127 -
.../simde-0.8.4-rc3/simde/arm/neon/qmovun.h | 159 -
.../simde-0.8.4-rc3/simde/arm/neon/qmovun_high.h | 84 -
.../simde-0.8.4-rc3/simde/arm/neon/qneg.h | 301 -
.../simde-0.8.4-rc3/simde/arm/neon/qrdmlah.h | 186 -
.../simde-0.8.4-rc3/simde/arm/neon/qrdmlah_lane.h | 162 -
.../simde-0.8.4-rc3/simde/arm/neon/qrdmlsh.h | 186 -
.../simde-0.8.4-rc3/simde/arm/neon/qrdmlsh_lane.h | 162 -
.../simde-0.8.4-rc3/simde/arm/neon/qrdmulh.h | 175 -
.../simde-0.8.4-rc3/simde/arm/neon/qrdmulh_lane.h | 173 -
.../simde-0.8.4-rc3/simde/arm/neon/qrdmulh_n.h | 136 -
.../simde-0.8.4-rc3/simde/arm/neon/qrshl.h | 750 -
.../simde-0.8.4-rc3/simde/arm/neon/qrshrn_high_n.h | 189 -
.../simde-0.8.4-rc3/simde/arm/neon/qrshrn_n.h | 163 -
.../simde/arm/neon/qrshrun_high_n.h | 113 -
.../simde-0.8.4-rc3/simde/arm/neon/qrshrun_n.h | 114 -
.../simde-0.8.4-rc3/simde/arm/neon/qshl.h | 741 -
.../simde-0.8.4-rc3/simde/arm/neon/qshl_n.h | 513 -
.../simde-0.8.4-rc3/simde/arm/neon/qshlu_n.h | 485 -
.../simde-0.8.4-rc3/simde/arm/neon/qshrn_high_n.h | 101 -
.../simde-0.8.4-rc3/simde/arm/neon/qshrn_n.h | 164 -
.../simde-0.8.4-rc3/simde/arm/neon/qshrun_high_n.h | 113 -
.../simde-0.8.4-rc3/simde/arm/neon/qshrun_n.h | 102 -
.../simde-0.8.4-rc3/simde/arm/neon/qsub.h | 718 -
.../simde-0.8.4-rc3/simde/arm/neon/qtbl.h | 724 -
.../simde-0.8.4-rc3/simde/arm/neon/qtbx.h | 749 -
.../simde-0.8.4-rc3/simde/arm/neon/raddhn.h | 182 -
.../simde-0.8.4-rc3/simde/arm/neon/raddhn_high.h | 102 -
.../simde-0.8.4-rc3/simde/arm/neon/rax.h | 64 -
.../simde-0.8.4-rc3/simde/arm/neon/rbit.h | 209 -
.../simde-0.8.4-rc3/simde/arm/neon/recpe.h | 347 -
.../simde-0.8.4-rc3/simde/arm/neon/recps.h | 188 -
.../simde-0.8.4-rc3/simde/arm/neon/recpx.h | 133 -
.../simde-0.8.4-rc3/simde/arm/neon/reinterpret.h | 7638 -----
.../simde-0.8.4-rc3/simde/arm/neon/rev16.h | 171 -
.../simde-0.8.4-rc3/simde/arm/neon/rev32.h | 302 -
.../simde-0.8.4-rc3/simde/arm/neon/rev64.h | 455 -
.../simde-0.8.4-rc3/simde/arm/neon/rhadd.h | 432 -
.../simde-0.8.4-rc3/simde/arm/neon/rnd.h | 208 -
.../simde-0.8.4-rc3/simde/arm/neon/rnd32x.h | 160 -
.../simde-0.8.4-rc3/simde/arm/neon/rnd32z.h | 160 -
.../simde-0.8.4-rc3/simde/arm/neon/rnd64x.h | 160 -
.../simde-0.8.4-rc3/simde/arm/neon/rnd64z.h | 160 -
.../simde-0.8.4-rc3/simde/arm/neon/rnda.h | 242 -
.../simde-0.8.4-rc3/simde/arm/neon/rndi.h | 200 -
.../simde-0.8.4-rc3/simde/arm/neon/rndm.h | 208 -
.../simde-0.8.4-rc3/simde/arm/neon/rndn.h | 228 -
.../simde-0.8.4-rc3/simde/arm/neon/rndp.h | 211 -
.../simde-0.8.4-rc3/simde/arm/neon/rndx.h | 194 -
.../simde-0.8.4-rc3/simde/arm/neon/rshl.h | 969 -
.../simde-0.8.4-rc3/simde/arm/neon/rshr_n.h | 528 -
.../simde-0.8.4-rc3/simde/arm/neon/rshrn_high_n.h | 101 -
.../simde-0.8.4-rc3/simde/arm/neon/rshrn_n.h | 101 -
.../simde-0.8.4-rc3/simde/arm/neon/rsqrte.h | 466 -
.../simde-0.8.4-rc3/simde/arm/neon/rsqrts.h | 218 -
.../simde-0.8.4-rc3/simde/arm/neon/rsra_n.h | 229 -
.../simde-0.8.4-rc3/simde/arm/neon/rsubhn.h | 209 -
.../simde-0.8.4-rc3/simde/arm/neon/rsubhn_high.h | 102 -
.../simde-0.8.4-rc3/simde/arm/neon/set_lane.h | 617 -
.../simde-0.8.4-rc3/simde/arm/neon/sha1.h | 208 -
.../simde-0.8.4-rc3/simde/arm/neon/sha256.h | 197 -
.../simde-0.8.4-rc3/simde/arm/neon/sha512.h | 157 -
.../simde-0.8.4-rc3/simde/arm/neon/shl.h | 1048 -
.../simde-0.8.4-rc3/simde/arm/neon/shl_n.h | 604 -
.../simde-0.8.4-rc3/simde/arm/neon/shll_high_n.h | 180 -
.../simde-0.8.4-rc3/simde/arm/neon/shll_n.h | 224 -
.../simde-0.8.4-rc3/simde/arm/neon/shr_n.h | 695 -
.../simde-0.8.4-rc3/simde/arm/neon/shrn_high_n.h | 114 -
.../simde-0.8.4-rc3/simde/arm/neon/shrn_n.h | 164 -
.../simde-0.8.4-rc3/simde/arm/neon/sli_n.h | 343 -
.../simde-0.8.4-rc3/simde/arm/neon/sm3.h | 267 -
.../simde-0.8.4-rc3/simde/arm/neon/sm4.h | 157 -
.../simde-0.8.4-rc3/simde/arm/neon/sqadd.h | 387 -
.../simde-0.8.4-rc3/simde/arm/neon/sqrt.h | 225 -
.../simde-0.8.4-rc3/simde/arm/neon/sra_n.h | 222 -
.../simde-0.8.4-rc3/simde/arm/neon/sri_n.h | 345 -
.../simde-0.8.4-rc3/simde/arm/neon/st1.h | 656 -
.../simde-0.8.4-rc3/simde/arm/neon/st1_lane.h | 530 -
.../simde-0.8.4-rc3/simde/arm/neon/st1_x2.h | 326 -
.../simde-0.8.4-rc3/simde/arm/neon/st1_x3.h | 341 -
.../simde-0.8.4-rc3/simde/arm/neon/st1_x4.h | 370 -
.../simde-0.8.4-rc3/simde/arm/neon/st1q_x2.h | 324 -
.../simde-0.8.4-rc3/simde/arm/neon/st1q_x3.h | 339 -
.../simde-0.8.4-rc3/simde/arm/neon/st1q_x4.h | 354 -
.../simde-0.8.4-rc3/simde/arm/neon/st2.h | 832 -
.../simde-0.8.4-rc3/simde/arm/neon/st2_lane.h | 622 -
.../simde-0.8.4-rc3/simde/arm/neon/st3.h | 1182 -
.../simde-0.8.4-rc3/simde/arm/neon/st3_lane.h | 622 -
.../simde-0.8.4-rc3/simde/arm/neon/st4.h | 924 -
.../simde-0.8.4-rc3/simde/arm/neon/st4_lane.h | 623 -
.../simde-0.8.4-rc3/simde/arm/neon/sub.h | 757 -
.../simde-0.8.4-rc3/simde/arm/neon/subhn.h | 211 -
.../simde-0.8.4-rc3/simde/arm/neon/subhn_high.h | 102 -
.../simde-0.8.4-rc3/simde/arm/neon/subl.h | 164 -
.../simde-0.8.4-rc3/simde/arm/neon/subl_high.h | 175 -
.../simde-0.8.4-rc3/simde/arm/neon/subw.h | 234 -
.../simde-0.8.4-rc3/simde/arm/neon/subw_high.h | 239 -
.../simde-0.8.4-rc3/simde/arm/neon/sudot_lane.h | 169 -
.../simde-0.8.4-rc3/simde/arm/neon/tbl.h | 338 -
.../simde-0.8.4-rc3/simde/arm/neon/tbx.h | 358 -
.../simde-0.8.4-rc3/simde/arm/neon/trn.h | 345 -
.../simde-0.8.4-rc3/simde/arm/neon/trn1.h | 692 -
.../simde-0.8.4-rc3/simde/arm/neon/trn2.h | 691 -
.../simde-0.8.4-rc3/simde/arm/neon/tst.h | 665 -
.../simde-0.8.4-rc3/simde/arm/neon/types.h | 1536 -
.../simde-0.8.4-rc3/simde/arm/neon/uqadd.h | 337 -
.../simde-0.8.4-rc3/simde/arm/neon/usdot.h | 95 -
.../simde-0.8.4-rc3/simde/arm/neon/usdot_lane.h | 169 -
.../simde-0.8.4-rc3/simde/arm/neon/uzp.h | 345 -
.../simde-0.8.4-rc3/simde/arm/neon/uzp1.h | 850 -
.../simde-0.8.4-rc3/simde/arm/neon/uzp2.h | 854 -
.../simde-0.8.4-rc3/simde/arm/neon/xar.h | 63 -
.../simde-0.8.4-rc3/simde/arm/neon/zip.h | 345 -
.../simde-0.8.4-rc3/simde/arm/neon/zip1.h | 864 -
.../simde-0.8.4-rc3/simde/arm/neon/zip2.h | 810 -
cpp/third_party/simde-0.8.4-rc3/simde/arm/sve.h | 47 -
.../simde-0.8.4-rc3/simde/arm/sve/add.h | 1350 -
.../simde-0.8.4-rc3/simde/arm/sve/and.h | 1003 -
.../simde-0.8.4-rc3/simde/arm/sve/cmplt.h | 503 -
.../simde-0.8.4-rc3/simde/arm/sve/cnt.h | 93 -
.../simde-0.8.4-rc3/simde/arm/sve/dup.h | 1133 -
.../simde-0.8.4-rc3/simde/arm/sve/ld1.h | 358 -
.../simde-0.8.4-rc3/simde/arm/sve/ptest.h | 71 -
.../simde-0.8.4-rc3/simde/arm/sve/ptrue.h | 157 -
.../simde-0.8.4-rc3/simde/arm/sve/qadd.h | 498 -
.../simde-0.8.4-rc3/simde/arm/sve/reinterpret.h | 754 -
.../simde-0.8.4-rc3/simde/arm/sve/sel.h | 626 -
.../simde-0.8.4-rc3/simde/arm/sve/st1.h | 307 -
.../simde-0.8.4-rc3/simde/arm/sve/sub.h | 1350 -
.../simde-0.8.4-rc3/simde/arm/sve/types.h | 915 -
.../simde-0.8.4-rc3/simde/arm/sve/whilelt.h | 843 -
cpp/third_party/simde-0.8.4-rc3/simde/check.h | 276 -
cpp/third_party/simde-0.8.4-rc3/simde/debug-trap.h | 85 -
cpp/third_party/simde-0.8.4-rc3/simde/hedley.h | 2049 --
cpp/third_party/simde-0.8.4-rc3/simde/mips/msa.h | 44 -
.../simde-0.8.4-rc3/simde/mips/msa/add_a.h | 207 -
.../simde-0.8.4-rc3/simde/mips/msa/adds.h | 429 -
.../simde-0.8.4-rc3/simde/mips/msa/adds_a.h | 237 -
.../simde-0.8.4-rc3/simde/mips/msa/addv.h | 183 -
.../simde-0.8.4-rc3/simde/mips/msa/addvi.h | 187 -
.../simde-0.8.4-rc3/simde/mips/msa/and.h | 75 -
.../simde-0.8.4-rc3/simde/mips/msa/andi.h | 76 -
.../simde-0.8.4-rc3/simde/mips/msa/ld.h | 203 -
.../simde-0.8.4-rc3/simde/mips/msa/madd.h | 123 -
.../simde-0.8.4-rc3/simde/mips/msa/st.h | 98 -
.../simde-0.8.4-rc3/simde/mips/msa/subv.h | 183 -
.../simde-0.8.4-rc3/simde/mips/msa/types.h | 363 -
cpp/third_party/simde-0.8.4-rc3/simde/simde-aes.h | 270 -
.../simde-0.8.4-rc3/simde/simde-align.h | 450 -
cpp/third_party/simde-0.8.4-rc3/simde/simde-arch.h | 702 -
cpp/third_party/simde-0.8.4-rc3/simde/simde-bf16.h | 131 -
.../simde-0.8.4-rc3/simde/simde-common.h | 1256 -
.../simde-0.8.4-rc3/simde/simde-complex.h | 148 -
.../simde-0.8.4-rc3/simde/simde-constify.h | 397 -
.../simde-0.8.4-rc3/simde/simde-detect-clang.h | 145 -
.../simde-0.8.4-rc3/simde/simde-diagnostic.h | 458 -
cpp/third_party/simde-0.8.4-rc3/simde/simde-f16.h | 375 -
.../simde-0.8.4-rc3/simde/simde-features.h | 795 -
cpp/third_party/simde-0.8.4-rc3/simde/simde-math.h | 2066 --
.../simde-0.8.4-rc3/simde/wasm/relaxed-simd.h | 607 -
.../simde-0.8.4-rc3/simde/wasm/simd128.h | 9318 ------
cpp/third_party/simde-0.8.4-rc3/simde/x86/aes.h | 431 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/avx.h | 7061 -----
cpp/third_party/simde-0.8.4-rc3/simde/x86/avx2.h | 6394 ----
cpp/third_party/simde-0.8.4-rc3/simde/x86/avx512.h | 151 -
.../simde-0.8.4-rc3/simde/x86/avx512/2intersect.h | 249 -
.../simde-0.8.4-rc3/simde/x86/avx512/4dpwssd.h | 93 -
.../simde-0.8.4-rc3/simde/x86/avx512/4dpwssds.h | 93 -
.../simde-0.8.4-rc3/simde/x86/avx512/abs.h | 664 -
.../simde-0.8.4-rc3/simde/x86/avx512/add.h | 812 -
.../simde-0.8.4-rc3/simde/x86/avx512/adds.h | 641 -
.../simde-0.8.4-rc3/simde/x86/avx512/and.h | 529 -
.../simde-0.8.4-rc3/simde/x86/avx512/andnot.h | 193 -
.../simde-0.8.4-rc3/simde/x86/avx512/avg.h | 258 -
.../simde-0.8.4-rc3/simde/x86/avx512/bitshuffle.h | 228 -
.../simde-0.8.4-rc3/simde/x86/avx512/blend.h | 359 -
.../simde-0.8.4-rc3/simde/x86/avx512/broadcast.h | 1024 -
.../simde-0.8.4-rc3/simde/x86/avx512/cast.h | 357 -
.../simde-0.8.4-rc3/simde/x86/avx512/cmp.h | 1722 -
.../simde-0.8.4-rc3/simde/x86/avx512/cmpeq.h | 1200 -
.../simde-0.8.4-rc3/simde/x86/avx512/cmpge.h | 1434 -
.../simde-0.8.4-rc3/simde/x86/avx512/cmpgt.h | 212 -
.../simde-0.8.4-rc3/simde/x86/avx512/cmple.h | 1432 -
.../simde-0.8.4-rc3/simde/x86/avx512/cmplt.h | 123 -
.../simde-0.8.4-rc3/simde/x86/avx512/cmpneq.h | 1196 -
.../simde-0.8.4-rc3/simde/x86/avx512/compress.h | 1140 -
.../simde-0.8.4-rc3/simde/x86/avx512/conflict.h | 378 -
.../simde-0.8.4-rc3/simde/x86/avx512/copysign.h | 86 -
.../simde-0.8.4-rc3/simde/x86/avx512/cvt.h | 403 -
.../simde-0.8.4-rc3/simde/x86/avx512/cvts.h | 782 -
.../simde-0.8.4-rc3/simde/x86/avx512/cvtt.h | 130 -
.../simde-0.8.4-rc3/simde/x86/avx512/cvtus.h | 67 -
.../simde-0.8.4-rc3/simde/x86/avx512/dbsad.h | 414 -
.../simde-0.8.4-rc3/simde/x86/avx512/div.h | 162 -
.../simde-0.8.4-rc3/simde/x86/avx512/dpbf16.h | 308 -
.../simde-0.8.4-rc3/simde/x86/avx512/dpbusd.h | 318 -
.../simde-0.8.4-rc3/simde/x86/avx512/dpbusds.h | 370 -
.../simde-0.8.4-rc3/simde/x86/avx512/dpwssd.h | 295 -
.../simde-0.8.4-rc3/simde/x86/avx512/dpwssds.h | 325 -
.../simde-0.8.4-rc3/simde/x86/avx512/expand.h | 1032 -
.../simde-0.8.4-rc3/simde/x86/avx512/expandloadu.h | 548 -
.../simde-0.8.4-rc3/simde/x86/avx512/extract.h | 267 -
.../simde-0.8.4-rc3/simde/x86/avx512/fixupimm.h | 934 -
.../simde/x86/avx512/fixupimm_round.h | 714 -
.../simde/x86/avx512/flushsubnormal.h | 117 -
.../simde-0.8.4-rc3/simde/x86/avx512/fmadd.h | 136 -
.../simde-0.8.4-rc3/simde/x86/avx512/fmaddsub.h | 117 -
.../simde-0.8.4-rc3/simde/x86/avx512/fmsub.h | 276 -
.../simde-0.8.4-rc3/simde/x86/avx512/fnmadd.h | 108 -
.../simde-0.8.4-rc3/simde/x86/avx512/fnmsub.h | 108 -
.../simde-0.8.4-rc3/simde/x86/avx512/fpclass.h | 99 -
.../simde-0.8.4-rc3/simde/x86/avx512/gather.h | 313 -
.../simde-0.8.4-rc3/simde/x86/avx512/insert.h | 578 -
.../simde-0.8.4-rc3/simde/x86/avx512/kand.h | 53 -
.../simde-0.8.4-rc3/simde/x86/avx512/knot.h | 106 -
.../simde-0.8.4-rc3/simde/x86/avx512/kshift.h | 152 -
.../simde-0.8.4-rc3/simde/x86/avx512/kxor.h | 107 -
.../simde-0.8.4-rc3/simde/x86/avx512/load.h | 148 -
.../simde-0.8.4-rc3/simde/x86/avx512/loadu.h | 661 -
.../simde-0.8.4-rc3/simde/x86/avx512/lzcnt.h | 476 -
.../simde-0.8.4-rc3/simde/x86/avx512/madd.h | 157 -
.../simde-0.8.4-rc3/simde/x86/avx512/maddubs.h | 159 -
.../simde-0.8.4-rc3/simde/x86/avx512/max.h | 611 -
.../simde-0.8.4-rc3/simde/x86/avx512/min.h | 611 -
.../simde-0.8.4-rc3/simde/x86/avx512/mov.h | 1041 -
.../simde-0.8.4-rc3/simde/x86/avx512/mov_mask.h | 372 -
.../simde-0.8.4-rc3/simde/x86/avx512/movm.h | 461 -
.../simde-0.8.4-rc3/simde/x86/avx512/mul.h | 279 -
.../simde-0.8.4-rc3/simde/x86/avx512/mulhi.h | 65 -
.../simde-0.8.4-rc3/simde/x86/avx512/mulhrs.h | 65 -
.../simde-0.8.4-rc3/simde/x86/avx512/mullo.h | 169 -
.../simde-0.8.4-rc3/simde/x86/avx512/multishift.h | 197 -
.../simde-0.8.4-rc3/simde/x86/avx512/negate.h | 88 -
.../simde-0.8.4-rc3/simde/x86/avx512/or.h | 308 -
.../simde-0.8.4-rc3/simde/x86/avx512/packs.h | 122 -
.../simde-0.8.4-rc3/simde/x86/avx512/packus.h | 122 -
.../simde-0.8.4-rc3/simde/x86/avx512/permutex.h | 102 -
.../simde/x86/avx512/permutex2var.h | 1645 -
.../simde-0.8.4-rc3/simde/x86/avx512/permutexvar.h | 1206 -
.../simde-0.8.4-rc3/simde/x86/avx512/popcnt.h | 1373 -
.../simde-0.8.4-rc3/simde/x86/avx512/range.h | 773 -
.../simde-0.8.4-rc3/simde/x86/avx512/range_round.h | 713 -
.../simde-0.8.4-rc3/simde/x86/avx512/rcp.h | 65 -
.../simde-0.8.4-rc3/simde/x86/avx512/reduce.h | 355 -
.../simde-0.8.4-rc3/simde/x86/avx512/rol.h | 437 -
.../simde-0.8.4-rc3/simde/x86/avx512/rolv.h | 441 -
.../simde-0.8.4-rc3/simde/x86/avx512/ror.h | 437 -
.../simde-0.8.4-rc3/simde/x86/avx512/rorv.h | 417 -
.../simde-0.8.4-rc3/simde/x86/avx512/round.h | 311 -
.../simde-0.8.4-rc3/simde/x86/avx512/roundscale.h | 644 -
.../simde/x86/avx512/roundscale_round.h | 717 -
.../simde-0.8.4-rc3/simde/x86/avx512/sad.h | 77 -
.../simde-0.8.4-rc3/simde/x86/avx512/scalef.h | 416 -
.../simde-0.8.4-rc3/simde/x86/avx512/set.h | 572 -
.../simde-0.8.4-rc3/simde/x86/avx512/set1.h | 352 -
.../simde-0.8.4-rc3/simde/x86/avx512/set4.h | 140 -
.../simde-0.8.4-rc3/simde/x86/avx512/setone.h | 72 -
.../simde-0.8.4-rc3/simde/x86/avx512/setr.h | 144 -
.../simde-0.8.4-rc3/simde/x86/avx512/setr4.h | 140 -
.../simde-0.8.4-rc3/simde/x86/avx512/setzero.h | 105 -
.../simde-0.8.4-rc3/simde/x86/avx512/shldv.h | 184 -
.../simde-0.8.4-rc3/simde/x86/avx512/shuffle.h | 417 -
.../simde-0.8.4-rc3/simde/x86/avx512/sll.h | 247 -
.../simde-0.8.4-rc3/simde/x86/avx512/slli.h | 360 -
.../simde-0.8.4-rc3/simde/x86/avx512/sllv.h | 122 -
.../simde-0.8.4-rc3/simde/x86/avx512/sqrt.h | 127 -
.../simde-0.8.4-rc3/simde/x86/avx512/sra.h | 81 -
.../simde-0.8.4-rc3/simde/x86/avx512/srai.h | 96 -
.../simde-0.8.4-rc3/simde/x86/avx512/srav.h | 67 -
.../simde-0.8.4-rc3/simde/x86/avx512/srl.h | 216 -
.../simde-0.8.4-rc3/simde/x86/avx512/srli.h | 361 -
.../simde-0.8.4-rc3/simde/x86/avx512/srlv.h | 282 -
.../simde-0.8.4-rc3/simde/x86/avx512/store.h | 93 -
.../simde-0.8.4-rc3/simde/x86/avx512/storeu.h | 444 -
.../simde-0.8.4-rc3/simde/x86/avx512/sub.h | 382 -
.../simde-0.8.4-rc3/simde/x86/avx512/subs.h | 222 -
.../simde/x86/avx512/ternarylogic.h | 3769 ---
.../simde-0.8.4-rc3/simde/x86/avx512/test.h | 232 -
.../simde-0.8.4-rc3/simde/x86/avx512/testn.h | 63 -
.../simde-0.8.4-rc3/simde/x86/avx512/types.h | 995 -
.../simde-0.8.4-rc3/simde/x86/avx512/unpackhi.h | 753 -
.../simde-0.8.4-rc3/simde/x86/avx512/unpacklo.h | 752 -
.../simde-0.8.4-rc3/simde/x86/avx512/xor.h | 319 -
.../simde-0.8.4-rc3/simde/x86/avx512/xorsign.h | 72 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/bmi.h | 172 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/clmul.h | 402 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/f16c.h | 279 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/fma.h | 813 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/gfni.h | 1311 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/mmx.h | 2388 --
cpp/third_party/simde-0.8.4-rc3/simde/x86/sse.h | 5004 ---
cpp/third_party/simde-0.8.4-rc3/simde/x86/sse2.h | 8746 ------
cpp/third_party/simde-0.8.4-rc3/simde/x86/sse3.h | 573 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/sse4.1.h | 2558 --
cpp/third_party/simde-0.8.4-rc3/simde/x86/sse4.2.h | 554 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/ssse3.h | 1111 -
cpp/third_party/simde-0.8.4-rc3/simde/x86/svml.h | 12113 -------
cpp/third_party/simde-0.8.4-rc3/simde/x86/xop.h | 3751 ---
cpp/third_party/simde-0.8.4-rc3/test/.gitignore | 7 -
.../simde-0.8.4-rc3/test/arm/declare-suites.h | 2 -
.../simde-0.8.4-rc3/test/arm/meson.build | 2 -
.../simde-0.8.4-rc3/test/arm/neon/aba.c | 963 -
.../simde-0.8.4-rc3/test/arm/neon/abal.c | 418 -
.../simde-0.8.4-rc3/test/arm/neon/abal_high.c | 458 -
.../simde-0.8.4-rc3/test/arm/neon/abd.c | 1396 -
.../simde-0.8.4-rc3/test/arm/neon/abdl.c | 389 -
.../simde-0.8.4-rc3/test/arm/neon/abdl_high.c | 539 -
.../simde-0.8.4-rc3/test/arm/neon/abs.c | 824 -
.../simde-0.8.4-rc3/test/arm/neon/add.c | 2142 --
.../simde-0.8.4-rc3/test/arm/neon/addhn.c | 390 -
.../simde-0.8.4-rc3/test/arm/neon/addhn_high.c | 580 -
.../simde-0.8.4-rc3/test/arm/neon/addl.c | 304 -
.../simde-0.8.4-rc3/test/arm/neon/addl_high.c | 336 -
.../simde-0.8.4-rc3/test/arm/neon/addlv.c | 615 -
.../simde-0.8.4-rc3/test/arm/neon/addv.c | 851 -
.../simde-0.8.4-rc3/test/arm/neon/addw.c | 303 -
.../simde-0.8.4-rc3/test/arm/neon/addw_high.c | 403 -
.../simde-0.8.4-rc3/test/arm/neon/aes.c | 438 -
.../simde-0.8.4-rc3/test/arm/neon/and.c | 798 -
.../simde-0.8.4-rc3/test/arm/neon/bcax.c | 664 -
.../simde-0.8.4-rc3/test/arm/neon/bic.c | 1027 -
.../simde-0.8.4-rc3/test/arm/neon/bsl.c | 2046 --
.../simde-0.8.4-rc3/test/arm/neon/cadd_rot270.c | 347 -
.../simde-0.8.4-rc3/test/arm/neon/cadd_rot90.c | 349 -
.../simde-0.8.4-rc3/test/arm/neon/cage.c | 545 -
.../simde-0.8.4-rc3/test/arm/neon/cagt.c | 549 -
.../simde-0.8.4-rc3/test/arm/neon/cale.c | 544 -
.../simde-0.8.4-rc3/test/arm/neon/calt.c | 547 -
.../simde-0.8.4-rc3/test/arm/neon/ceq.c | 1975 --
.../simde-0.8.4-rc3/test/arm/neon/ceqz.c | 1526 -
.../simde-0.8.4-rc3/test/arm/neon/cge.c | 1884 --
.../simde-0.8.4-rc3/test/arm/neon/cgez.c | 1014 -
.../simde-0.8.4-rc3/test/arm/neon/cgt.c | 1803 --
.../simde-0.8.4-rc3/test/arm/neon/cgtz.c | 1014 -
.../simde-0.8.4-rc3/test/arm/neon/cle.c | 1878 --
.../simde-0.8.4-rc3/test/arm/neon/clez.c | 951 -
.../simde-0.8.4-rc3/test/arm/neon/cls.c | 708 -
.../simde-0.8.4-rc3/test/arm/neon/clt.c | 1797 --
.../simde-0.8.4-rc3/test/arm/neon/cltz.c | 926 -
.../simde-0.8.4-rc3/test/arm/neon/clz.c | 1038 -
.../simde-0.8.4-rc3/test/arm/neon/cmla.c | 422 -
.../simde-0.8.4-rc3/test/arm/neon/cmla_lane.c | 853 -
.../simde-0.8.4-rc3/test/arm/neon/cmla_rot180.c | 422 -
.../test/arm/neon/cmla_rot180_lane.c | 848 -
.../simde-0.8.4-rc3/test/arm/neon/cmla_rot270.c | 422 -
.../test/arm/neon/cmla_rot270_lane.c | 860 -
.../simde-0.8.4-rc3/test/arm/neon/cmla_rot90.c | 422 -
.../test/arm/neon/cmla_rot90_lane.c | 850 -
.../simde-0.8.4-rc3/test/arm/neon/cnt.c | 369 -
.../simde-0.8.4-rc3/test/arm/neon/combine.c | 961 -
.../simde-0.8.4-rc3/test/arm/neon/copy_lane.c | 7174 -----
.../simde-0.8.4-rc3/test/arm/neon/crc32.c | 516 -
.../simde-0.8.4-rc3/test/arm/neon/create.c | 733 -
.../simde-0.8.4-rc3/test/arm/neon/cvt.c | 4216 ---
.../simde-0.8.4-rc3/test/arm/neon/cvt_n.c | 3384 --
.../simde-0.8.4-rc3/test/arm/neon/cvtm.c | 1199 -
.../simde-0.8.4-rc3/test/arm/neon/cvtn.c | 968 -
.../simde-0.8.4-rc3/test/arm/neon/cvtp.c | 1187 -
.../simde-0.8.4-rc3/test/arm/neon/div.c | 508 -
.../simde-0.8.4-rc3/test/arm/neon/dot.c | 491 -
.../simde-0.8.4-rc3/test/arm/neon/dot_lane.c | 1054 -
.../simde-0.8.4-rc3/test/arm/neon/dup_lane.c | 4480 ---
.../simde-0.8.4-rc3/test/arm/neon/dup_n.c | 1536 -
.../simde-0.8.4-rc3/test/arm/neon/eor.c | 1872 --
.../simde-0.8.4-rc3/test/arm/neon/ext.c | 2264 --
.../simde-0.8.4-rc3/test/arm/neon/fma.c | 501 -
.../simde-0.8.4-rc3/test/arm/neon/fma_lane.c | 1651 -
.../simde-0.8.4-rc3/test/arm/neon/fma_n.c | 441 -
.../simde-0.8.4-rc3/test/arm/neon/fmlal.c | 1517 -
.../simde-0.8.4-rc3/test/arm/neon/fmlsl.c | 833 -
.../simde-0.8.4-rc3/test/arm/neon/fms.c | 348 -
.../simde-0.8.4-rc3/test/arm/neon/fms_lane.c | 1239 -
.../simde-0.8.4-rc3/test/arm/neon/fms_n.c | 304 -
.../simde-0.8.4-rc3/test/arm/neon/get_high.c | 799 -
.../simde-0.8.4-rc3/test/arm/neon/get_lane.c | 1454 -
.../simde-0.8.4-rc3/test/arm/neon/get_low.c | 799 -
.../simde-0.8.4-rc3/test/arm/neon/hadd.c | 789 -
.../simde-0.8.4-rc3/test/arm/neon/hsub.c | 789 -
.../simde-0.8.4-rc3/test/arm/neon/ld1_dup.c | 1802 --
.../simde-0.8.4-rc3/test/arm/neon/ld1_lane.c | 1790 --
.../simde-0.8.4-rc3/test/arm/neon/ld1_x2.c | 1004 -
.../simde-0.8.4-rc3/test/arm/neon/ld1_x3.c | 1199 -
.../simde-0.8.4-rc3/test/arm/neon/ld1_x4.c | 1363 -
.../simde-0.8.4-rc3/test/arm/neon/ld1q_x2.c | 1175 -
.../simde-0.8.4-rc3/test/arm/neon/ld1q_x3.c | 1483 -
.../simde-0.8.4-rc3/test/arm/neon/ld1q_x4.c | 1915 --
.../simde-0.8.4-rc3/test/arm/neon/ld2.c | 2363 --
.../simde-0.8.4-rc3/test/arm/neon/ld2_dup.c | 1936 --
.../simde-0.8.4-rc3/test/arm/neon/ld2_lane.c | 2198 --
.../simde-0.8.4-rc3/test/arm/neon/ld3.c | 315 -
.../simde-0.8.4-rc3/test/arm/neon/ld3_dup.c | 2303 --
.../simde-0.8.4-rc3/test/arm/neon/ld3_lane.c | 2732 --
.../simde-0.8.4-rc3/test/arm/neon/ld4.c | 293 -
.../simde-0.8.4-rc3/test/arm/neon/ld4_dup.c | 2620 --
.../simde-0.8.4-rc3/test/arm/neon/ld4_lane.c | 3071 --
.../simde-0.8.4-rc3/test/arm/neon/max.c | 1459 -
.../simde-0.8.4-rc3/test/arm/neon/maxnm.c | 501 -
.../simde-0.8.4-rc3/test/arm/neon/maxnmv.c | 283 -
.../simde-0.8.4-rc3/test/arm/neon/maxv.c | 874 -
.../simde-0.8.4-rc3/test/arm/neon/meson.build | 37 -
.../simde-0.8.4-rc3/test/arm/neon/min.c | 1500 -
.../simde-0.8.4-rc3/test/arm/neon/minnm.c | 501 -
.../simde-0.8.4-rc3/test/arm/neon/minnmv.c | 277 -
.../simde-0.8.4-rc3/test/arm/neon/minv.c | 889 -
.../simde-0.8.4-rc3/test/arm/neon/mla.c | 978 -
.../simde-0.8.4-rc3/test/arm/neon/mla_lane.c | 1756 --
.../simde-0.8.4-rc3/test/arm/neon/mla_n.c | 752 -
.../simde-0.8.4-rc3/test/arm/neon/mlal.c | 459 -
.../simde-0.8.4-rc3/test/arm/neon/mlal_high.c | 497 -
.../simde-0.8.4-rc3/test/arm/neon/mlal_high_lane.c | 605 -
.../simde-0.8.4-rc3/test/arm/neon/mlal_high_n.c | 317 -
.../simde-0.8.4-rc3/test/arm/neon/mlal_lane.c | 1039 -
.../simde-0.8.4-rc3/test/arm/neon/mlal_n.c | 317 -
.../simde-0.8.4-rc3/test/arm/neon/mls.c | 1235 -
.../simde-0.8.4-rc3/test/arm/neon/mls_lane.c | 1601 -
.../simde-0.8.4-rc3/test/arm/neon/mls_n.c | 742 -
.../simde-0.8.4-rc3/test/arm/neon/mlsl.c | 461 -
.../simde-0.8.4-rc3/test/arm/neon/mlsl_high.c | 493 -
.../simde-0.8.4-rc3/test/arm/neon/mlsl_high_lane.c | 605 -
.../simde-0.8.4-rc3/test/arm/neon/mlsl_high_n.c | 317 -
.../simde-0.8.4-rc3/test/arm/neon/mlsl_lane.c | 1043 -
.../simde-0.8.4-rc3/test/arm/neon/mlsl_n.c | 315 -
.../simde-0.8.4-rc3/test/arm/neon/mmlaq.c | 470 -
.../simde-0.8.4-rc3/test/arm/neon/modify_c.txt | 83 -
.../simde-0.8.4-rc3/test/arm/neon/movl.c | 246 -
.../simde-0.8.4-rc3/test/arm/neon/movl_high.c | 259 -
.../simde-0.8.4-rc3/test/arm/neon/movn.c | 314 -
.../simde-0.8.4-rc3/test/arm/neon/movn_high.c | 405 -
.../simde-0.8.4-rc3/test/arm/neon/mul.c | 1725 -
.../simde-0.8.4-rc3/test/arm/neon/mul_lane.c | 2369 --
.../simde-0.8.4-rc3/test/arm/neon/mul_n.c | 815 -
.../simde-0.8.4-rc3/test/arm/neon/mull.c | 548 -
.../simde-0.8.4-rc3/test/arm/neon/mull_high.c | 611 -
.../simde-0.8.4-rc3/test/arm/neon/mull_high_lane.c | 667 -
.../simde-0.8.4-rc3/test/arm/neon/mull_high_n.c | 292 -
.../simde-0.8.4-rc3/test/arm/neon/mull_lane.c | 888 -
.../simde-0.8.4-rc3/test/arm/neon/mull_n.c | 273 -
.../simde-0.8.4-rc3/test/arm/neon/mulx.c | 598 -
.../simde-0.8.4-rc3/test/arm/neon/mulx_lane.c | 1285 -
.../simde-0.8.4-rc3/test/arm/neon/mulx_n.c | 169 -
.../simde-0.8.4-rc3/test/arm/neon/mvn.c | 748 -
.../simde-0.8.4-rc3/test/arm/neon/neg.c | 734 -
.../simde-0.8.4-rc3/test/arm/neon/orn.c | 1028 -
.../simde-0.8.4-rc3/test/arm/neon/orr.c | 798 -
.../simde-0.8.4-rc3/test/arm/neon/padal.c | 756 -
.../simde-0.8.4-rc3/test/arm/neon/padd.c | 1425 -
.../simde-0.8.4-rc3/test/arm/neon/paddl.c | 468 -
.../simde-0.8.4-rc3/test/arm/neon/pmax.c | 1206 -
.../simde-0.8.4-rc3/test/arm/neon/pmaxnm.c | 440 -
.../simde-0.8.4-rc3/test/arm/neon/pmin.c | 1221 -
.../simde-0.8.4-rc3/test/arm/neon/pminnm.c | 455 -
.../simde-0.8.4-rc3/test/arm/neon/qabs.c | 631 -
.../simde-0.8.4-rc3/test/arm/neon/qadd.c | 1477 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlal.c | 296 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlal_high.c | 177 -
.../test/arm/neon/qdmlal_high_lane.c | 364 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlal_high_n.c | 167 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlal_lane.c | 714 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlal_n.c | 158 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlsl.c | 296 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlsl_high.c | 177 -
.../test/arm/neon/qdmlsl_high_lane.c | 366 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlsl_high_n.c | 167 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlsl_lane.c | 715 -
.../simde-0.8.4-rc3/test/arm/neon/qdmlsl_n.c | 158 -
.../simde-0.8.4-rc3/test/arm/neon/qdmulh.c | 378 -
.../simde-0.8.4-rc3/test/arm/neon/qdmulh_lane.c | 1215 -
.../simde-0.8.4-rc3/test/arm/neon/qdmulh_n.c | 153 -
.../simde-0.8.4-rc3/test/arm/neon/qdmull.c | 242 -
.../simde-0.8.4-rc3/test/arm/neon/qdmull_high.c | 142 -
.../test/arm/neon/qdmull_high_lane.c | 280 -
.../simde-0.8.4-rc3/test/arm/neon/qdmull_high_n.c | 134 -
.../simde-0.8.4-rc3/test/arm/neon/qdmull_lane.c | 722 -
.../simde-0.8.4-rc3/test/arm/neon/qdmull_n.c | 126 -
.../simde-0.8.4-rc3/test/arm/neon/qmovn.c | 327 -
.../simde-0.8.4-rc3/test/arm/neon/qmovn_high.c | 415 -
.../simde-0.8.4-rc3/test/arm/neon/qmovun.c | 180 -
.../simde-0.8.4-rc3/test/arm/neon/qmovun_high.c | 267 -
.../simde-0.8.4-rc3/test/arm/neon/qneg.c | 625 -
.../simde-0.8.4-rc3/test/arm/neon/qrdmlah.c | 447 -
.../simde-0.8.4-rc3/test/arm/neon/qrdmlah_lane.c | 1305 -
.../simde-0.8.4-rc3/test/arm/neon/qrdmlsh.c | 499 -
.../simde-0.8.4-rc3/test/arm/neon/qrdmlsh_lane.c | 1305 -
.../simde-0.8.4-rc3/test/arm/neon/qrdmulh.c | 288 -
.../simde-0.8.4-rc3/test/arm/neon/qrdmulh_lane.c | 1260 -
.../simde-0.8.4-rc3/test/arm/neon/qrdmulh_n.c | 288 -
.../simde-0.8.4-rc3/test/arm/neon/qrshl.c | 5456 ----
.../simde-0.8.4-rc3/test/arm/neon/qrshrn_high_n.c | 714 -
.../simde-0.8.4-rc3/test/arm/neon/qrshrn_n.c | 1149 -
.../simde-0.8.4-rc3/test/arm/neon/qrshrun_high_n.c | 374 -
.../simde-0.8.4-rc3/test/arm/neon/qrshrun_n.c | 619 -
.../simde-0.8.4-rc3/test/arm/neon/qshl.c | 4437 ---
.../simde-0.8.4-rc3/test/arm/neon/qshl_n.c | 1295 -
.../simde-0.8.4-rc3/test/arm/neon/qshlu_n.c | 2152 --
.../simde-0.8.4-rc3/test/arm/neon/qshrn_high_n.c | 713 -
.../simde-0.8.4-rc3/test/arm/neon/qshrn_n.c | 1197 -
.../simde-0.8.4-rc3/test/arm/neon/qshrun_high_n.c | 481 -
.../simde-0.8.4-rc3/test/arm/neon/qshrun_n.c | 635 -
.../simde-0.8.4-rc3/test/arm/neon/qsub.c | 1477 -
.../simde-0.8.4-rc3/test/arm/neon/qtbl.c | 2533 --
.../simde-0.8.4-rc3/test/arm/neon/qtbx.c | 2749 --
.../simde-0.8.4-rc3/test/arm/neon/raddhn.c | 396 -
.../simde-0.8.4-rc3/test/arm/neon/raddhn_high.c | 469 -
.../simde-0.8.4-rc3/test/arm/neon/rax.c | 95 -
.../simde-0.8.4-rc3/test/arm/neon/rbit.c | 376 -
.../simde-0.8.4-rc3/test/arm/neon/recpe.c | 573 -
.../simde-0.8.4-rc3/test/arm/neon/recps.c | 582 -
.../simde-0.8.4-rc3/test/arm/neon/recpx.c | 183 -
.../simde-0.8.4-rc3/test/arm/neon/reinterpret.c | 20798 ------------
.../simde-0.8.4-rc3/test/arm/neon/rev16.c | 376 -
.../simde-0.8.4-rc3/test/arm/neon/rev32.c | 656 -
.../simde-0.8.4-rc3/test/arm/neon/rev64.c | 1046 -
.../simde-0.8.4-rc3/test/arm/neon/rhadd.c | 803 -
.../simde-0.8.4-rc3/test/arm/neon/rnd.c | 419 -
.../simde-0.8.4-rc3/test/arm/neon/rnd32x.c | 249 -
.../simde-0.8.4-rc3/test/arm/neon/rnd32z.c | 249 -
.../simde-0.8.4-rc3/test/arm/neon/rnd64x.c | 249 -
.../simde-0.8.4-rc3/test/arm/neon/rnd64z.c | 249 -
.../simde-0.8.4-rc3/test/arm/neon/rnda.c | 404 -
.../simde-0.8.4-rc3/test/arm/neon/rndi.c | 423 -
.../simde-0.8.4-rc3/test/arm/neon/rndm.c | 423 -
.../simde-0.8.4-rc3/test/arm/neon/rndn.c | 395 -
.../simde-0.8.4-rc3/test/arm/neon/rndp.c | 419 -
.../simde-0.8.4-rc3/test/arm/neon/rndx.c | 406 -
.../simde-0.8.4-rc3/test/arm/neon/rshl.c | 1476 -
.../simde-0.8.4-rc3/test/arm/neon/rshr_n.c | 1954 --
.../simde-0.8.4-rc3/test/arm/neon/rshrn_high_n.c | 671 -
.../simde-0.8.4-rc3/test/arm/neon/rshrn_n.c | 644 -
.../simde-0.8.4-rc3/test/arm/neon/rsqrte.c | 530 -
.../simde-0.8.4-rc3/test/arm/neon/rsqrts.c | 540 -
.../simde-0.8.4-rc3/test/arm/neon/rsra_n.c | 1814 --
.../simde-0.8.4-rc3/test/arm/neon/rsubhn.c | 396 -
.../simde-0.8.4-rc3/test/arm/neon/rsubhn_high.c | 469 -
.../simde-0.8.4-rc3/test/arm/neon/run-tests-neon.h | 3 -
.../simde-0.8.4-rc3/test/arm/neon/run-tests.c | 30 -
.../simde-0.8.4-rc3/test/arm/neon/run-tests.h | 8 -
.../simde-0.8.4-rc3/test/arm/neon/set_lane.c | 2284 --
.../simde-0.8.4-rc3/test/arm/neon/sha1.c | 431 -
.../simde-0.8.4-rc3/test/arm/neon/sha256.c | 311 -
.../simde-0.8.4-rc3/test/arm/neon/sha512.c | 311 -
.../simde-0.8.4-rc3/test/arm/neon/shl.c | 797 -
.../simde-0.8.4-rc3/test/arm/neon/shl_n.c | 1412 -
.../simde-0.8.4-rc3/test/arm/neon/shll_high_n.c | 783 -
.../simde-0.8.4-rc3/test/arm/neon/shll_n.c | 777 -
.../simde-0.8.4-rc3/test/arm/neon/shr_n.c | 1662 -
.../simde-0.8.4-rc3/test/arm/neon/shrn_high_n.c | 1066 -
.../simde-0.8.4-rc3/test/arm/neon/shrn_n.c | 642 -
.../simde-0.8.4-rc3/test/arm/neon/skel-single.c | 668 -
.../simde-0.8.4-rc3/test/arm/neon/skel-triple.c | 828 -
.../simde-0.8.4-rc3/test/arm/neon/skel.c | 748 -
.../simde-0.8.4-rc3/test/arm/neon/sli_n.c | 2750 --
.../simde-0.8.4-rc3/test/arm/neon/sm3.c | 588 -
.../simde-0.8.4-rc3/test/arm/neon/sm4.c | 155 -
.../simde-0.8.4-rc3/test/arm/neon/sqadd.c | 751 -
.../simde-0.8.4-rc3/test/arm/neon/sqrt.c | 312 -
.../simde-0.8.4-rc3/test/arm/neon/sra_n.c | 1859 --
.../simde-0.8.4-rc3/test/arm/neon/sri_n.c | 2752 --
.../simde-0.8.4-rc3/test/arm/neon/st1_lane.c | 1718 -
.../simde-0.8.4-rc3/test/arm/neon/st1_x2.c | 1062 -
.../simde-0.8.4-rc3/test/arm/neon/st1_x3.c | 1359 -
.../simde-0.8.4-rc3/test/arm/neon/st1_x4.c | 1568 -
.../simde-0.8.4-rc3/test/arm/neon/st1q_x2.c | 1374 -
.../simde-0.8.4-rc3/test/arm/neon/st1q_x3.c | 1759 --
.../simde-0.8.4-rc3/test/arm/neon/st1q_x4.c | 2112 --
.../simde-0.8.4-rc3/test/arm/neon/st2.c | 2121 --
.../simde-0.8.4-rc3/test/arm/neon/st2_lane.c | 1872 --
.../simde-0.8.4-rc3/test/arm/neon/st3.c | 6524 ----
.../simde-0.8.4-rc3/test/arm/neon/st3_lane.c | 1991 --
.../simde-0.8.4-rc3/test/arm/neon/st4.c | 8082 -----
.../simde-0.8.4-rc3/test/arm/neon/st4_lane.c | 2208 --
.../simde-0.8.4-rc3/test/arm/neon/sub.c | 1135 -
.../simde-0.8.4-rc3/test/arm/neon/subhn.c | 390 -
.../simde-0.8.4-rc3/test/arm/neon/subhn_high.c | 581 -
.../simde-0.8.4-rc3/test/arm/neon/subl.c | 387 -
.../simde-0.8.4-rc3/test/arm/neon/subl_high.c | 421 -
.../simde-0.8.4-rc3/test/arm/neon/subw.c | 387 -
.../simde-0.8.4-rc3/test/arm/neon/subw_high.c | 403 -
.../simde-0.8.4-rc3/test/arm/neon/sudot_lane.c | 512 -
.../simde-0.8.4-rc3/test/arm/neon/tbl.c | 1010 -
.../simde-0.8.4-rc3/test/arm/neon/tbx.c | 1078 -
.../test/arm/neon/test-neon-footer.h | 29 -
.../simde-0.8.4-rc3/test/arm/neon/test-neon.h | 759 -
.../simde-0.8.4-rc3/test/arm/neon/trn.c | 1994 --
.../simde-0.8.4-rc3/test/arm/neon/trn1.c | 1563 -
.../simde-0.8.4-rc3/test/arm/neon/trn2.c | 1563 -
.../simde-0.8.4-rc3/test/arm/neon/tst.c | 1494 -
.../simde-0.8.4-rc3/test/arm/neon/uqadd.c | 771 -
.../simde-0.8.4-rc3/test/arm/neon/usdot.c | 212 -
.../simde-0.8.4-rc3/test/arm/neon/usdot_lane.c | 562 -
.../simde-0.8.4-rc3/test/arm/neon/uzp.c | 1955 --
.../simde-0.8.4-rc3/test/arm/neon/uzp1.c | 1567 -
.../simde-0.8.4-rc3/test/arm/neon/uzp2.c | 1555 -
.../simde-0.8.4-rc3/test/arm/neon/xar.c | 106 -
.../simde-0.8.4-rc3/test/arm/neon/zip.c | 1940 --
.../simde-0.8.4-rc3/test/arm/neon/zip1.c | 1491 -
.../simde-0.8.4-rc3/test/arm/neon/zip2.c | 1491 -
.../simde-0.8.4-rc3/test/arm/run-tests.c | 22 -
.../simde-0.8.4-rc3/test/arm/run-tests.h | 10 -
cpp/third_party/simde-0.8.4-rc3/test/arm/sve/add.c | 7739 -----
cpp/third_party/simde-0.8.4-rc3/test/arm/sve/and.c | 3901 ---
.../simde-0.8.4-rc3/test/arm/sve/cmplt.c | 2134 --
cpp/third_party/simde-0.8.4-rc3/test/arm/sve/dup.c | 4406 ---
.../simde-0.8.4-rc3/test/arm/sve/meson.build | 32 -
.../simde-0.8.4-rc3/test/arm/sve/qadd.c | 3007 --
.../simde-0.8.4-rc3/test/arm/sve/run-tests-neon.h | 3 -
.../simde-0.8.4-rc3/test/arm/sve/run-tests.c | 30 -
.../simde-0.8.4-rc3/test/arm/sve/run-tests.h | 8 -
cpp/third_party/simde-0.8.4-rc3/test/arm/sve/sel.c | 4607 ---
cpp/third_party/simde-0.8.4-rc3/test/arm/sve/sub.c | 9434 ------
.../simde-0.8.4-rc3/test/arm/sve/test-sve-footer.h | 29 -
.../simde-0.8.4-rc3/test/arm/sve/test-sve.h | 50 -
.../simde-0.8.4-rc3/test/arm/test-arm.h | 0
cpp/third_party/simde-0.8.4-rc3/test/arm64cl.txt | 17 -
.../simde-0.8.4-rc3/test/check-flags.sh | 92 -
.../test/cmake-packaging/CMakeLists.txt | 27 -
.../cmake-fetchcontent/CMakeLists.txt | 16 -
.../test/cmake-packaging/cmake-fetchcontent/main.c | 9 -
.../cmake-packaging/cmake-fetchcontent/main.cpp | 9 -
.../cmake-find-package/CMakeLists.txt | 15 -
.../test/cmake-packaging/cmake-find-package/main.c | 9 -
.../cmake-packaging/cmake-find-package/main.cpp | 9 -
.../simde-0.8.4-rc3/test/common/common.c | 119 -
.../simde-0.8.4-rc3/test/common/meson.build | 29 -
.../simde-0.8.4-rc3/test/declare-suites.h | 4 -
.../test/docker/Dockerfile.Ubuntu1404 | 12 -
.../test/docker/Dockerfile.Ubuntu1604 | 34 -
.../test/docker/Dockerfile.Ubuntu1804 | 11 -
.../simde-0.8.4-rc3/test/docker/Dockerfile.arm64 | 26 -
.../simde-0.8.4-rc3/test/docker/Dockerfile.arm7 | 30 -
.../simde-0.8.4-rc3/test/docker/Dockerfile.icc | 21 -
.../simde-0.8.4-rc3/test/docker/Dockerfile.mipsel | 9 -
.../simde-0.8.4-rc3/test/docker/Dockerfile.ppc64el | 26 -
.../test/docker/Dockerfile.qemu5.s390x | 22 -
.../simde-0.8.4-rc3/test/docker/Dockerfile.s390x | 24 -
.../simde-0.8.4-rc3/test/download-iig.sh | 12 -
.../simde-0.8.4-rc3/test/download-sde.sh | 9 -
cpp/third_party/simde-0.8.4-rc3/test/meson.build | 67 -
.../simde-0.8.4-rc3/test/mips/declare-suites.h | 1 -
.../simde-0.8.4-rc3/test/mips/meson.build | 1 -
.../simde-0.8.4-rc3/test/mips/msa/add_a.c | 295 -
.../simde-0.8.4-rc3/test/mips/msa/adds.c | 555 -
.../simde-0.8.4-rc3/test/mips/msa/adds_a.c | 295 -
.../simde-0.8.4-rc3/test/mips/msa/addv.c | 295 -
.../simde-0.8.4-rc3/test/mips/msa/addvi.c | 359 -
.../simde-0.8.4-rc3/test/mips/msa/and.c | 118 -
.../simde-0.8.4-rc3/test/mips/msa/andi.c | 140 -
cpp/third_party/simde-0.8.4-rc3/test/mips/msa/ld.c | 230 -
.../simde-0.8.4-rc3/test/mips/msa/madd.c | 177 -
.../simde-0.8.4-rc3/test/mips/msa/meson.build | 33 -
.../simde-0.8.4-rc3/test/mips/msa/run-tests-msa.h | 3 -
.../simde-0.8.4-rc3/test/mips/msa/run-tests.c | 30 -
.../simde-0.8.4-rc3/test/mips/msa/run-tests.h | 8 -
cpp/third_party/simde-0.8.4-rc3/test/mips/msa/st.c | 292 -
.../simde-0.8.4-rc3/test/mips/msa/subv.c | 295 -
.../test/mips/msa/test-msa-footer.h | 29 -
.../simde-0.8.4-rc3/test/mips/msa/test-msa.h | 161 -
.../simde-0.8.4-rc3/test/mips/run-tests.c | 48 -
.../simde-0.8.4-rc3/test/mips/run-tests.h | 35 -
.../simde-0.8.4-rc3/test/native-aliases.sh | 75 -
cpp/third_party/simde-0.8.4-rc3/test/run-tests.c | 23 -
cpp/third_party/simde-0.8.4-rc3/test/run-tests.h | 10 -
cpp/third_party/simde-0.8.4-rc3/test/test.h | 1243 -
.../simde-0.8.4-rc3/test/wasm/declare-suites.h | 2 -
.../simde-0.8.4-rc3/test/wasm/meson.build | 2 -
.../test/wasm/relaxed-simd/laneselect.c | 354 -
.../simde-0.8.4-rc3/test/wasm/relaxed-simd/madd.c | 186 -
.../simde-0.8.4-rc3/test/wasm/relaxed-simd/max.c | 149 -
.../test/wasm/relaxed-simd/meson.build | 41 -
.../simde-0.8.4-rc3/test/wasm/relaxed-simd/min.c | 149 -
.../simde-0.8.4-rc3/test/wasm/relaxed-simd/nmadd.c | 186 -
.../test/wasm/relaxed-simd/run-tests-wasm.h | 3 -
.../test/wasm/relaxed-simd/run-tests.c | 30 -
.../test/wasm/relaxed-simd/run-tests.h | 8 -
.../test/wasm/relaxed-simd/swizzle.c | 118 -
.../wasm/relaxed-simd/test-relaxed-simd-footer.h | 29 -
.../test/wasm/relaxed-simd/test-relaxed-simd.h | 12 -
.../simde-0.8.4-rc3/test/wasm/relaxed-simd/trunc.c | 226 -
.../simde-0.8.4-rc3/test/wasm/run-tests.c | 22 -
.../simde-0.8.4-rc3/test/wasm/run-tests.h | 10 -
.../simde-0.8.4-rc3/test/wasm/simd128/abs.c | 368 -
.../simde-0.8.4-rc3/test/wasm/simd128/add.c | 427 -
.../simde-0.8.4-rc3/test/wasm/simd128/add_sat.c | 322 -
.../simde-0.8.4-rc3/test/wasm/simd128/all_true.c | 263 -
.../simde-0.8.4-rc3/test/wasm/simd128/and.c | 91 -
.../simde-0.8.4-rc3/test/wasm/simd128/andnot.c | 91 -
.../simde-0.8.4-rc3/test/wasm/simd128/any_true.c | 96 -
.../simde-0.8.4-rc3/test/wasm/simd128/avgr.c | 178 -
.../simde-0.8.4-rc3/test/wasm/simd128/bitmask.c | 230 -
.../simde-0.8.4-rc3/test/wasm/simd128/bitselect.c | 103 -
.../simde-0.8.4-rc3/test/wasm/simd128/ceil.c | 138 -
.../simde-0.8.4-rc3/test/wasm/simd128/const.c | 617 -
.../simde-0.8.4-rc3/test/wasm/simd128/convert.c | 222 -
.../simde-0.8.4-rc3/test/wasm/simd128/demote.c | 86 -
.../simde-0.8.4-rc3/test/wasm/simd128/div.c | 162 -
.../simde-0.8.4-rc3/test/wasm/simd128/dot.c | 94 -
.../simde-0.8.4-rc3/test/wasm/simd128/eq.c | 450 -
.../test/wasm/simd128/extadd_pairwise.c | 242 -
.../test/wasm/simd128/extend_high.c | 338 -
.../simde-0.8.4-rc3/test/wasm/simd128/extend_low.c | 338 -
.../test/wasm/simd128/extmul_high.c | 426 -
.../simde-0.8.4-rc3/test/wasm/simd128/extmul_low.c | 426 -
.../test/wasm/simd128/extract_lane.c | 678 -
.../simde-0.8.4-rc3/test/wasm/simd128/floor.c | 138 -
.../simde-0.8.4-rc3/test/wasm/simd128/ge.c | 675 -
.../simde-0.8.4-rc3/test/wasm/simd128/gt.c | 675 -
.../simde-0.8.4-rc3/test/wasm/simd128/le.c | 675 -
.../simde-0.8.4-rc3/test/wasm/simd128/load.c | 316 -
.../simde-0.8.4-rc3/test/wasm/simd128/load_lane.c | 338 -
.../simde-0.8.4-rc3/test/wasm/simd128/load_splat.c | 226 -
.../simde-0.8.4-rc3/test/wasm/simd128/load_zero.c | 126 -
.../simde-0.8.4-rc3/test/wasm/simd128/lt.c | 675 -
.../simde-0.8.4-rc3/test/wasm/simd128/make.c | 569 -
.../simde-0.8.4-rc3/test/wasm/simd128/max.c | 576 -
.../simde-0.8.4-rc3/test/wasm/simd128/meson.build | 94 -
.../simde-0.8.4-rc3/test/wasm/simd128/min.c | 576 -
.../simde-0.8.4-rc3/test/wasm/simd128/mul.c | 342 -
.../simde-0.8.4-rc3/test/wasm/simd128/narrow.c | 298 -
.../simde-0.8.4-rc3/test/wasm/simd128/ne.c | 450 -
.../simde-0.8.4-rc3/test/wasm/simd128/nearest.c | 146 -
.../simde-0.8.4-rc3/test/wasm/simd128/neg.c | 360 -
.../simde-0.8.4-rc3/test/wasm/simd128/not.c | 79 -
.../simde-0.8.4-rc3/test/wasm/simd128/or.c | 91 -
.../simde-0.8.4-rc3/test/wasm/simd128/pmax.c | 162 -
.../simde-0.8.4-rc3/test/wasm/simd128/pmin.c | 162 -
.../simde-0.8.4-rc3/test/wasm/simd128/popcnt.c | 106 -
.../simde-0.8.4-rc3/test/wasm/simd128/promote.c | 86 -
.../test/wasm/simd128/q15mulr_sat.c | 97 -
.../test/wasm/simd128/replace_lane.c | 392 -
.../test/wasm/simd128/run-tests-wasm.h | 3 -
.../simde-0.8.4-rc3/test/wasm/simd128/run-tests.c | 30 -
.../simde-0.8.4-rc3/test/wasm/simd128/run-tests.h | 8 -
.../simde-0.8.4-rc3/test/wasm/simd128/shl.c | 296 -
.../simde-0.8.4-rc3/test/wasm/simd128/shr.c | 558 -
.../simde-0.8.4-rc3/test/wasm/simd128/shuffle.c | 390 -
.../simde-0.8.4-rc3/test/wasm/simd128/splat.c | 510 -
.../simde-0.8.4-rc3/test/wasm/simd128/sqrt.c | 140 -
.../simde-0.8.4-rc3/test/wasm/simd128/store_lane.c | 282 -
.../simde-0.8.4-rc3/test/wasm/simd128/sub.c | 426 -
.../simde-0.8.4-rc3/test/wasm/simd128/sub_sat.c | 322 -
.../simde-0.8.4-rc3/test/wasm/simd128/swizzle.c | 118 -
.../test/wasm/simd128/test-simd128-footer.h | 29 -
.../test/wasm/simd128/test-simd128.h | 12 -
.../simde-0.8.4-rc3/test/wasm/simd128/trunc.c | 138 -
.../simde-0.8.4-rc3/test/wasm/simd128/trunc_sat.c | 270 -
.../simde-0.8.4-rc3/test/wasm/simd128/xor.c | 91 -
.../test/wasm/test-simd128-footer.h | 29 -
.../simde-0.8.4-rc3/test/wasm/test-simd128.h | 151 -
cpp/third_party/simde-0.8.4-rc3/test/x86/aes.c | 358 -
cpp/third_party/simde-0.8.4-rc3/test/x86/avx.c | 16836 ----------
cpp/third_party/simde-0.8.4-rc3/test/x86/avx2.c | 17006 ----------
.../simde-0.8.4-rc3/test/x86/avx512/2intersect.c | 405 -
.../simde-0.8.4-rc3/test/x86/avx512/4dpwssd.c | 519 -
.../simde-0.8.4-rc3/test/x86/avx512/4dpwssds.c | 519 -
.../simde-0.8.4-rc3/test/x86/avx512/abs.c | 3529 ---
.../simde-0.8.4-rc3/test/x86/avx512/add.c | 4490 ---
.../simde-0.8.4-rc3/test/x86/avx512/adds.c | 5553 ----
.../simde-0.8.4-rc3/test/x86/avx512/and.c | 3008 --
.../simde-0.8.4-rc3/test/x86/avx512/andnot.c | 1727 -
.../simde-0.8.4-rc3/test/x86/avx512/avg.c | 2630 --
.../simde-0.8.4-rc3/test/x86/avx512/bitshuffle.c | 449 -
.../simde-0.8.4-rc3/test/x86/avx512/blend.c | 1881 --
.../simde-0.8.4-rc3/test/x86/avx512/broadcast.c | 4031 ---
.../simde-0.8.4-rc3/test/x86/avx512/cast.c | 1531 -
.../simde-0.8.4-rc3/test/x86/avx512/cmp.c | 5994 ----
.../simde-0.8.4-rc3/test/x86/avx512/cmpeq.c | 4718 ---
.../simde-0.8.4-rc3/test/x86/avx512/cmpge.c | 7068 -----
.../simde-0.8.4-rc3/test/x86/avx512/cmpgt.c | 1085 -
.../simde-0.8.4-rc3/test/x86/avx512/cmple.c | 7067 -----
.../simde-0.8.4-rc3/test/x86/avx512/cmplt.c | 757 -
.../simde-0.8.4-rc3/test/x86/avx512/cmpneq.c | 4574 ---
.../simde-0.8.4-rc3/test/x86/avx512/compress.c | 2757 --
.../simde-0.8.4-rc3/test/x86/avx512/conflict.c | 1287 -
.../simde-0.8.4-rc3/test/x86/avx512/copysign.c | 247 -
.../simde-0.8.4-rc3/test/x86/avx512/cvt.c | 1365 -
.../simde-0.8.4-rc3/test/x86/avx512/cvts.c | 2608 --
.../simde-0.8.4-rc3/test/x86/avx512/cvtt.c | 294 -
.../simde-0.8.4-rc3/test/x86/avx512/cvtus.c | 165 -
.../simde-0.8.4-rc3/test/x86/avx512/dbsad.c | 1760 --
.../simde-0.8.4-rc3/test/x86/avx512/div.c | 824 -
.../simde-0.8.4-rc3/test/x86/avx512/dpbf16.c | 1230 -
.../simde-0.8.4-rc3/test/x86/avx512/dpbusd.c | 829 -
.../simde-0.8.4-rc3/test/x86/avx512/dpbusds.c | 829 -
.../simde-0.8.4-rc3/test/x86/avx512/dpwssd.c | 829 -
.../simde-0.8.4-rc3/test/x86/avx512/dpwssds.c | 993 -
.../simde-0.8.4-rc3/test/x86/avx512/expand.c | 3231 --
.../simde-0.8.4-rc3/test/x86/avx512/expandloadu.c | 2654 --
.../simde-0.8.4-rc3/test/x86/avx512/extract.c | 1625 -
.../simde-0.8.4-rc3/test/x86/avx512/fixupimm.c | 3787 ---
.../test/x86/avx512/fixupimm_round.c | 2179 --
.../test/x86/avx512/flushsubnormal.c | 178 -
.../simde-0.8.4-rc3/test/x86/avx512/fmadd.c | 595 -
.../simde-0.8.4-rc3/test/x86/avx512/fmaddsub.c | 457 -
.../simde-0.8.4-rc3/test/x86/avx512/fmsub.c | 1351 -
.../simde-0.8.4-rc3/test/x86/avx512/fnmadd.c | 276 -
.../simde-0.8.4-rc3/test/x86/avx512/fnmsub.c | 276 -
.../simde-0.8.4-rc3/test/x86/avx512/fpclass.c | 230 -
.../simde-0.8.4-rc3/test/x86/avx512/gather.c | 834 -
.../simde-0.8.4-rc3/test/x86/avx512/insert.c | 3050 --
.../simde-0.8.4-rc3/test/x86/avx512/kand.c | 91 -
.../simde-0.8.4-rc3/test/x86/avx512/knot.c | 260 -
.../simde-0.8.4-rc3/test/x86/avx512/kshift.c | 524 -
.../simde-0.8.4-rc3/test/x86/avx512/kxor.c | 316 -
.../simde-0.8.4-rc3/test/x86/avx512/load.c | 554 -
.../simde-0.8.4-rc3/test/x86/avx512/loadu.c | 3855 ---
.../simde-0.8.4-rc3/test/x86/avx512/lzcnt.c | 1137 -
.../simde-0.8.4-rc3/test/x86/avx512/madd.c | 692 -
.../simde-0.8.4-rc3/test/x86/avx512/maddubs.c | 1130 -
.../simde-0.8.4-rc3/test/x86/avx512/max.c | 4119 ---
.../simde-0.8.4-rc3/test/x86/avx512/meson.build | 30 -
.../simde-0.8.4-rc3/test/x86/avx512/min.c | 4119 ---
.../simde-0.8.4-rc3/test/x86/avx512/mov.c | 3875 ---
.../simde-0.8.4-rc3/test/x86/avx512/mov_mask.c | 801 -
.../simde-0.8.4-rc3/test/x86/avx512/movm.c | 787 -
.../simde-0.8.4-rc3/test/x86/avx512/mul.c | 1564 -
.../simde-0.8.4-rc3/test/x86/avx512/mulhi.c | 152 -
.../simde-0.8.4-rc3/test/x86/avx512/mulhrs.c | 156 -
.../simde-0.8.4-rc3/test/x86/avx512/mullo.c | 681 -
.../simde-0.8.4-rc3/test/x86/avx512/multishift.c | 1299 -
.../simde-0.8.4-rc3/test/x86/avx512/negate.c | 192 -
.../simde-0.8.4-rc3/test/x86/avx512/or.c | 1248 -
.../simde-0.8.4-rc3/test/x86/avx512/packs.c | 268 -
.../simde-0.8.4-rc3/test/x86/avx512/packus.c | 268 -
.../simde-0.8.4-rc3/test/x86/avx512/permutex.c | 258 -
.../simde-0.8.4-rc3/test/x86/avx512/permutex2var.c | 8916 ------
.../simde-0.8.4-rc3/test/x86/avx512/permutexvar.c | 5157 ---
.../simde-0.8.4-rc3/test/x86/avx512/popcnt.c | 3055 --
.../simde-0.8.4-rc3/test/x86/avx512/range.c | 3016 --
.../simde-0.8.4-rc3/test/x86/avx512/range_round.c | 1919 --
.../simde-0.8.4-rc3/test/x86/avx512/rcp.c | 135 -
.../simde-0.8.4-rc3/test/x86/avx512/reduce.c | 938 -
.../simde-0.8.4-rc3/test/x86/avx512/rol.c | 2461 --
.../simde-0.8.4-rc3/test/x86/avx512/rolv.c | 1445 -
.../simde-0.8.4-rc3/test/x86/avx512/ror.c | 2988 --
.../simde-0.8.4-rc3/test/x86/avx512/rorv.c | 1447 -
.../simde-0.8.4-rc3/test/x86/avx512/round.c | 383 -
.../simde-0.8.4-rc3/test/x86/avx512/roundscale.c | 6811 ----
.../test/x86/avx512/roundscale_round.c | 1873 --
.../simde-0.8.4-rc3/test/x86/avx512/run-tests.c | 30 -
.../simde-0.8.4-rc3/test/x86/avx512/run-tests.h | 8 -
.../simde-0.8.4-rc3/test/x86/avx512/sad.c | 200 -
.../simde-0.8.4-rc3/test/x86/avx512/scalef.c | 2216 --
.../simde-0.8.4-rc3/test/x86/avx512/set.c | 1456 -
.../simde-0.8.4-rc3/test/x86/avx512/set1.c | 1668 -
.../simde-0.8.4-rc3/test/x86/avx512/set4.c | 361 -
.../simde-0.8.4-rc3/test/x86/avx512/setone.c | 45 -
.../simde-0.8.4-rc3/test/x86/avx512/setr.c | 625 -
.../simde-0.8.4-rc3/test/x86/avx512/setr4.c | 361 -
.../simde-0.8.4-rc3/test/x86/avx512/setzero.c | 71 -
.../simde-0.8.4-rc3/test/x86/avx512/shldv.c | 105 -
.../simde-0.8.4-rc3/test/x86/avx512/shuffle.c | 4544 ---
.../simde-0.8.4-rc3/test/x86/avx512/skel.c | 35 -
.../simde-0.8.4-rc3/test/x86/avx512/sll.c | 798 -
.../simde-0.8.4-rc3/test/x86/avx512/slli.c | 1795 --
.../simde-0.8.4-rc3/test/x86/avx512/sllv.c | 334 -
.../simde-0.8.4-rc3/test/x86/avx512/sqrt.c | 403 -
.../simde-0.8.4-rc3/test/x86/avx512/sra.c | 128 -
.../simde-0.8.4-rc3/test/x86/avx512/srai.c | 404 -
.../simde-0.8.4-rc3/test/x86/avx512/srav.c | 152 -
.../simde-0.8.4-rc3/test/x86/avx512/srl.c | 561 -
.../simde-0.8.4-rc3/test/x86/avx512/srli.c | 1649 -
.../simde-0.8.4-rc3/test/x86/avx512/srlv.c | 1010 -
.../simde-0.8.4-rc3/test/x86/avx512/store.c | 131 -
.../simde-0.8.4-rc3/test/x86/avx512/storeu.c | 2330 --
.../simde-0.8.4-rc3/test/x86/avx512/sub.c | 3328 --
.../simde-0.8.4-rc3/test/x86/avx512/subs.c | 3166 --
.../simde-0.8.4-rc3/test/x86/avx512/ternarylogic.c | 6412 ----
.../test/x86/avx512/test-avx512-footer.h | 29 -
.../simde-0.8.4-rc3/test/x86/avx512/test-avx512.h | 65 -
.../simde-0.8.4-rc3/test/x86/avx512/test.c | 1147 -
.../simde-0.8.4-rc3/test/x86/avx512/testn.c | 123 -
.../simde-0.8.4-rc3/test/x86/avx512/unpackhi.c | 4441 ---
.../simde-0.8.4-rc3/test/x86/avx512/unpacklo.c | 4689 ---
.../simde-0.8.4-rc3/test/x86/avx512/xor.c | 1180 -
.../simde-0.8.4-rc3/test/x86/avx512/xorsign.c | 247 -
cpp/third_party/simde-0.8.4-rc3/test/x86/bmi.c | 394 -
cpp/third_party/simde-0.8.4-rc3/test/x86/clmul.c | 391 -
cpp/third_party/simde-0.8.4-rc3/test/x86/f16c.c | 527 -
cpp/third_party/simde-0.8.4-rc3/test/x86/fma.c | 2439 --
cpp/third_party/simde-0.8.4-rc3/test/x86/gfni.c | 7428 -----
.../simde-0.8.4-rc3/test/x86/meson.build | 53 -
cpp/third_party/simde-0.8.4-rc3/test/x86/mmx.c | 5315 ----
.../simde-0.8.4-rc3/test/x86/run-tests.c | 32 -
.../simde-0.8.4-rc3/test/x86/run-tests.h | 9 -
cpp/third_party/simde-0.8.4-rc3/test/x86/skel.c | 2274 --
cpp/third_party/simde-0.8.4-rc3/test/x86/sse.c | 5988 ----
cpp/third_party/simde-0.8.4-rc3/test/x86/sse2.c | 10919 -------
cpp/third_party/simde-0.8.4-rc3/test/x86/sse3.c | 813 -
cpp/third_party/simde-0.8.4-rc3/test/x86/sse4.1.c | 3743 ---
cpp/third_party/simde-0.8.4-rc3/test/x86/sse4.2.c | 3479 --
cpp/third_party/simde-0.8.4-rc3/test/x86/ssse3.c | 1927 --
cpp/third_party/simde-0.8.4-rc3/test/x86/svml.c | 31376 -------------------
.../simde-0.8.4-rc3/test/x86/test-avx.h | 305 -
.../simde-0.8.4-rc3/test/x86/test-mmx.h | 35 -
.../simde-0.8.4-rc3/test/x86/test-sse.h | 17 -
.../simde-0.8.4-rc3/test/x86/test-sse2.h | 33 -
.../simde-0.8.4-rc3/test/x86/test-x86-footer.h | 29 -
.../simde-0.8.4-rc3/test/x86/test-x86.h | 188 -
cpp/third_party/simde-0.8.4-rc3/test/x86/xop.c | 7450 -----
.../zlib-1.3.1/.github/workflows/cmake.yml | 89 -
.../zlib-1.3.1/.github/workflows/configure.yml | 136 -
.../zlib-1.3.1/.github/workflows/fuzz.yml | 25 -
cpp/third_party/zlib-1.3.1/.gitignore | 36 -
cpp/third_party/zlib-1.3.1/CMakeLists.txt | 219 -
cpp/third_party/zlib-1.3.1/ChangeLog | 1618 -
cpp/third_party/zlib-1.3.1/FAQ | 367 -
cpp/third_party/zlib-1.3.1/INDEX | 68 -
cpp/third_party/zlib-1.3.1/LICENSE | 22 -
cpp/third_party/zlib-1.3.1/Makefile | 5 -
cpp/third_party/zlib-1.3.1/Makefile.in | 410 -
cpp/third_party/zlib-1.3.1/README | 117 -
cpp/third_party/zlib-1.3.1/adler32.c | 164 -
cpp/third_party/zlib-1.3.1/amiga/Makefile.pup | 69 -
cpp/third_party/zlib-1.3.1/amiga/Makefile.sas | 68 -
cpp/third_party/zlib-1.3.1/compress.c | 75 -
cpp/third_party/zlib-1.3.1/configure | 929 -
cpp/third_party/zlib-1.3.1/contrib/README.contrib | 57 -
.../zlib-1.3.1/contrib/ada/buffer_demo.adb | 106 -
cpp/third_party/zlib-1.3.1/contrib/ada/mtest.adb | 156 -
cpp/third_party/zlib-1.3.1/contrib/ada/read.adb | 156 -
cpp/third_party/zlib-1.3.1/contrib/ada/readme.txt | 65 -
cpp/third_party/zlib-1.3.1/contrib/ada/test.adb | 463 -
.../zlib-1.3.1/contrib/ada/zlib-streams.adb | 225 -
.../zlib-1.3.1/contrib/ada/zlib-streams.ads | 114 -
.../zlib-1.3.1/contrib/ada/zlib-thin.adb | 141 -
.../zlib-1.3.1/contrib/ada/zlib-thin.ads | 450 -
cpp/third_party/zlib-1.3.1/contrib/ada/zlib.adb | 701 -
cpp/third_party/zlib-1.3.1/contrib/ada/zlib.ads | 328 -
cpp/third_party/zlib-1.3.1/contrib/ada/zlib.gpr | 20 -
cpp/third_party/zlib-1.3.1/contrib/blast/Makefile | 8 -
cpp/third_party/zlib-1.3.1/contrib/blast/README | 4 -
cpp/third_party/zlib-1.3.1/contrib/blast/blast.c | 466 -
cpp/third_party/zlib-1.3.1/contrib/blast/blast.h | 83 -
cpp/third_party/zlib-1.3.1/contrib/blast/test.pk | Bin 8 -> 0 bytes
cpp/third_party/zlib-1.3.1/contrib/blast/test.txt | 1 -
cpp/third_party/zlib-1.3.1/contrib/delphi/ZLib.pas | 557 -
.../zlib-1.3.1/contrib/delphi/ZLibConst.pas | 11 -
.../zlib-1.3.1/contrib/delphi/readme.txt | 76 -
.../zlib-1.3.1/contrib/delphi/zlibd32.mak | 99 -
.../zlib-1.3.1/contrib/dotzlib/DotZLib.build | 33 -
.../zlib-1.3.1/contrib/dotzlib/DotZLib.chm | Bin 72726 -> 0 bytes
.../zlib-1.3.1/contrib/dotzlib/DotZLib.sln | 21 -
.../contrib/dotzlib/DotZLib/AssemblyInfo.cs | 58 -
.../contrib/dotzlib/DotZLib/ChecksumImpl.cs | 202 -
.../contrib/dotzlib/DotZLib/CircularBuffer.cs | 83 -
.../contrib/dotzlib/DotZLib/CodecBase.cs | 198 -
.../zlib-1.3.1/contrib/dotzlib/DotZLib/Deflater.cs | 106 -
.../zlib-1.3.1/contrib/dotzlib/DotZLib/DotZLib.cs | 288 -
.../contrib/dotzlib/DotZLib/DotZLib.csproj | 141 -
.../contrib/dotzlib/DotZLib/GZipStream.cs | 301 -
.../zlib-1.3.1/contrib/dotzlib/DotZLib/Inflater.cs | 105 -
.../contrib/dotzlib/DotZLib/UnitTests.cs | 274 -
.../zlib-1.3.1/contrib/dotzlib/LICENSE_1_0.txt | 23 -
.../zlib-1.3.1/contrib/dotzlib/readme.txt | 58 -
.../zlib-1.3.1/contrib/gcc_gvmat64/gvmat64.S | 574 -
cpp/third_party/zlib-1.3.1/contrib/infback9/README | 1 -
.../zlib-1.3.1/contrib/infback9/infback9.c | 603 -
.../zlib-1.3.1/contrib/infback9/infback9.h | 37 -
.../zlib-1.3.1/contrib/infback9/inffix9.h | 107 -
.../zlib-1.3.1/contrib/infback9/inflate9.h | 47 -
.../zlib-1.3.1/contrib/infback9/inftree9.c | 319 -
.../zlib-1.3.1/contrib/infback9/inftree9.h | 61 -
.../zlib-1.3.1/contrib/iostream/test.cpp | 24 -
.../zlib-1.3.1/contrib/iostream/zfstream.cpp | 329 -
.../zlib-1.3.1/contrib/iostream/zfstream.h | 128 -
.../zlib-1.3.1/contrib/iostream2/zstream.h | 307 -
.../zlib-1.3.1/contrib/iostream2/zstream_test.cpp | 25 -
.../zlib-1.3.1/contrib/iostream3/README | 35 -
cpp/third_party/zlib-1.3.1/contrib/iostream3/TODO | 17 -
.../zlib-1.3.1/contrib/iostream3/test.cc | 50 -
.../zlib-1.3.1/contrib/iostream3/zfstream.cc | 479 -
.../zlib-1.3.1/contrib/iostream3/zfstream.h | 466 -
.../zlib-1.3.1/contrib/minizip/Makefile | 29 -
.../zlib-1.3.1/contrib/minizip/Makefile.am | 45 -
.../contrib/minizip/MiniZip64_Changes.txt | 6 -
.../zlib-1.3.1/contrib/minizip/MiniZip64_info.txt | 74 -
.../zlib-1.3.1/contrib/minizip/configure.ac | 32 -
cpp/third_party/zlib-1.3.1/contrib/minizip/crypt.h | 128 -
cpp/third_party/zlib-1.3.1/contrib/minizip/ioapi.c | 231 -
cpp/third_party/zlib-1.3.1/contrib/minizip/ioapi.h | 210 -
.../zlib-1.3.1/contrib/minizip/iowin32.c | 440 -
.../zlib-1.3.1/contrib/minizip/iowin32.h | 28 -
.../zlib-1.3.1/contrib/minizip/make_vms.com | 25 -
.../zlib-1.3.1/contrib/minizip/miniunz.c | 647 -
.../zlib-1.3.1/contrib/minizip/miniunzip.1 | 63 -
.../zlib-1.3.1/contrib/minizip/minizip.1 | 46 -
.../zlib-1.3.1/contrib/minizip/minizip.c | 509 -
.../zlib-1.3.1/contrib/minizip/minizip.pc.in | 12 -
.../zlib-1.3.1/contrib/minizip/mztools.c | 285 -
.../zlib-1.3.1/contrib/minizip/mztools.h | 37 -
cpp/third_party/zlib-1.3.1/contrib/minizip/unzip.c | 1985 --
cpp/third_party/zlib-1.3.1/contrib/minizip/unzip.h | 437 -
cpp/third_party/zlib-1.3.1/contrib/minizip/zip.c | 1956 --
cpp/third_party/zlib-1.3.1/contrib/minizip/zip.h | 364 -
.../zlib-1.3.1/contrib/nuget/nuget.csproj | 43 -
cpp/third_party/zlib-1.3.1/contrib/nuget/nuget.sln | 22 -
.../zlib-1.3.1/contrib/pascal/example.pas | 599 -
.../zlib-1.3.1/contrib/pascal/readme.txt | 76 -
.../zlib-1.3.1/contrib/pascal/zlibd32.mak | 99 -
.../zlib-1.3.1/contrib/pascal/zlibpas.pas | 276 -
cpp/third_party/zlib-1.3.1/contrib/puff/Makefile | 42 -
cpp/third_party/zlib-1.3.1/contrib/puff/README | 63 -
cpp/third_party/zlib-1.3.1/contrib/puff/puff.c | 840 -
cpp/third_party/zlib-1.3.1/contrib/puff/puff.h | 35 -
cpp/third_party/zlib-1.3.1/contrib/puff/pufftest.c | 165 -
cpp/third_party/zlib-1.3.1/contrib/puff/zeros.raw | Bin 2517 -> 0 bytes
.../zlib-1.3.1/contrib/testzlib/testzlib.c | 275 -
.../zlib-1.3.1/contrib/testzlib/testzlib.txt | 10 -
cpp/third_party/zlib-1.3.1/contrib/untgz/Makefile | 14 -
.../zlib-1.3.1/contrib/untgz/Makefile.msc | 17 -
cpp/third_party/zlib-1.3.1/contrib/untgz/untgz.c | 667 -
.../zlib-1.3.1/contrib/vstudio/readme.txt | 81 -
.../contrib/vstudio/vc10/miniunz.vcxproj | 310 -
.../contrib/vstudio/vc10/miniunz.vcxproj.filters | 22 -
.../contrib/vstudio/vc10/minizip.vcxproj | 307 -
.../contrib/vstudio/vc10/minizip.vcxproj.filters | 22 -
.../contrib/vstudio/vc10/testzlib.vcxproj | 412 -
.../contrib/vstudio/vc10/testzlib.vcxproj.filters | 55 -
.../contrib/vstudio/vc10/testzlibdll.vcxproj | 310 -
.../vstudio/vc10/testzlibdll.vcxproj.filters | 22 -
.../zlib-1.3.1/contrib/vstudio/vc10/zlib.rc | 32 -
.../contrib/vstudio/vc10/zlibstat.vcxproj | 449 -
.../contrib/vstudio/vc10/zlibstat.vcxproj.filters | 74 -
.../zlib-1.3.1/contrib/vstudio/vc10/zlibvc.def | 158 -
.../zlib-1.3.1/contrib/vstudio/vc10/zlibvc.sln | 135 -
.../zlib-1.3.1/contrib/vstudio/vc10/zlibvc.vcxproj | 633 -
.../contrib/vstudio/vc10/zlibvc.vcxproj.filters | 115 -
.../contrib/vstudio/vc11/miniunz.vcxproj | 314 -
.../contrib/vstudio/vc11/minizip.vcxproj | 311 -
.../contrib/vstudio/vc11/testzlib.vcxproj | 418 -
.../contrib/vstudio/vc11/testzlibdll.vcxproj | 314 -
.../zlib-1.3.1/contrib/vstudio/vc11/zlib.rc | 32 -
.../contrib/vstudio/vc11/zlibstat.vcxproj | 456 -
.../zlib-1.3.1/contrib/vstudio/vc11/zlibvc.def | 158 -
.../zlib-1.3.1/contrib/vstudio/vc11/zlibvc.sln | 117 -
.../zlib-1.3.1/contrib/vstudio/vc11/zlibvc.vcxproj | 664 -
.../contrib/vstudio/vc12/miniunz.vcxproj | 316 -
.../contrib/vstudio/vc12/minizip.vcxproj | 313 -
.../contrib/vstudio/vc12/testzlib.vcxproj | 422 -
.../contrib/vstudio/vc12/testzlibdll.vcxproj | 316 -
.../zlib-1.3.1/contrib/vstudio/vc12/zlib.rc | 32 -
.../contrib/vstudio/vc12/zlibstat.vcxproj | 459 -
.../zlib-1.3.1/contrib/vstudio/vc12/zlibvc.def | 158 -
.../zlib-1.3.1/contrib/vstudio/vc12/zlibvc.sln | 119 -
.../zlib-1.3.1/contrib/vstudio/vc12/zlibvc.vcxproj | 668 -
.../contrib/vstudio/vc14/miniunz.vcxproj | 316 -
.../contrib/vstudio/vc14/minizip.vcxproj | 313 -
.../contrib/vstudio/vc14/testzlib.vcxproj | 422 -
.../contrib/vstudio/vc14/testzlibdll.vcxproj | 316 -
.../zlib-1.3.1/contrib/vstudio/vc14/zlib.rc | 32 -
.../contrib/vstudio/vc14/zlibstat.vcxproj | 459 -
.../zlib-1.3.1/contrib/vstudio/vc14/zlibvc.def | 158 -
.../zlib-1.3.1/contrib/vstudio/vc14/zlibvc.sln | 119 -
.../zlib-1.3.1/contrib/vstudio/vc14/zlibvc.vcxproj | 668 -
.../contrib/vstudio/vc17/miniunz.vcxproj | 409 -
.../contrib/vstudio/vc17/minizip.vcxproj | 405 -
.../contrib/vstudio/vc17/testzlib.vcxproj | 473 -
.../contrib/vstudio/vc17/testzlibdll.vcxproj | 409 -
.../zlib-1.3.1/contrib/vstudio/vc17/zlib.rc | 32 -
.../contrib/vstudio/vc17/zlibstat.vcxproj | 602 -
.../zlib-1.3.1/contrib/vstudio/vc17/zlibvc.def | 158 -
.../zlib-1.3.1/contrib/vstudio/vc17/zlibvc.sln | 179 -
.../zlib-1.3.1/contrib/vstudio/vc17/zlibvc.vcxproj | 875 -
.../zlib-1.3.1/contrib/vstudio/vc9/miniunz.vcproj | 565 -
.../zlib-1.3.1/contrib/vstudio/vc9/minizip.vcproj | 562 -
.../zlib-1.3.1/contrib/vstudio/vc9/testzlib.vcproj | 796 -
.../contrib/vstudio/vc9/testzlibdll.vcproj | 565 -
.../zlib-1.3.1/contrib/vstudio/vc9/zlib.rc | 32 -
.../zlib-1.3.1/contrib/vstudio/vc9/zlibstat.vcproj | 781 -
.../zlib-1.3.1/contrib/vstudio/vc9/zlibvc.def | 158 -
.../zlib-1.3.1/contrib/vstudio/vc9/zlibvc.sln | 144 -
.../zlib-1.3.1/contrib/vstudio/vc9/zlibvc.vcproj | 1100 -
cpp/third_party/zlib-1.3.1/crc32.c | 1049 -
cpp/third_party/zlib-1.3.1/crc32.h | 9446 ------
cpp/third_party/zlib-1.3.1/deflate.c | 2139 --
cpp/third_party/zlib-1.3.1/deflate.h | 377 -
cpp/third_party/zlib-1.3.1/doc/algorithm.txt | 209 -
cpp/third_party/zlib-1.3.1/doc/crc-doc.1.0.pdf | Bin 776142 -> 0 bytes
cpp/third_party/zlib-1.3.1/doc/rfc1950.txt | 619 -
cpp/third_party/zlib-1.3.1/doc/rfc1951.txt | 955 -
cpp/third_party/zlib-1.3.1/doc/rfc1952.txt | 675 -
cpp/third_party/zlib-1.3.1/doc/txtvsbin.txt | 107 -
.../zlib-1.3.1/examples/README.examples | 54 -
cpp/third_party/zlib-1.3.1/examples/enough.c | 597 -
cpp/third_party/zlib-1.3.1/examples/fitblk.c | 233 -
cpp/third_party/zlib-1.3.1/examples/gun.c | 702 -
cpp/third_party/zlib-1.3.1/examples/gzappend.c | 504 -
cpp/third_party/zlib-1.3.1/examples/gzjoin.c | 449 -
cpp/third_party/zlib-1.3.1/examples/gzlog.c | 1061 -
cpp/third_party/zlib-1.3.1/examples/gzlog.h | 91 -
cpp/third_party/zlib-1.3.1/examples/gznorm.c | 470 -
cpp/third_party/zlib-1.3.1/examples/zlib_how.html | 549 -
cpp/third_party/zlib-1.3.1/examples/zpipe.c | 205 -
cpp/third_party/zlib-1.3.1/examples/zran.c | 533 -
cpp/third_party/zlib-1.3.1/examples/zran.h | 51 -
cpp/third_party/zlib-1.3.1/gzclose.c | 23 -
cpp/third_party/zlib-1.3.1/gzguts.h | 214 -
cpp/third_party/zlib-1.3.1/gzlib.c | 582 -
cpp/third_party/zlib-1.3.1/gzread.c | 602 -
cpp/third_party/zlib-1.3.1/gzwrite.c | 631 -
cpp/third_party/zlib-1.3.1/infback.c | 628 -
cpp/third_party/zlib-1.3.1/inffast.c | 320 -
cpp/third_party/zlib-1.3.1/inffast.h | 11 -
cpp/third_party/zlib-1.3.1/inffixed.h | 94 -
cpp/third_party/zlib-1.3.1/inflate.c | 1526 -
cpp/third_party/zlib-1.3.1/inflate.h | 126 -
cpp/third_party/zlib-1.3.1/inftrees.c | 299 -
cpp/third_party/zlib-1.3.1/inftrees.h | 62 -
cpp/third_party/zlib-1.3.1/make_vms.com | 867 -
cpp/third_party/zlib-1.3.1/msdos/Makefile.bor | 115 -
cpp/third_party/zlib-1.3.1/msdos/Makefile.dj2 | 104 -
cpp/third_party/zlib-1.3.1/msdos/Makefile.emx | 69 -
cpp/third_party/zlib-1.3.1/msdos/Makefile.msc | 112 -
cpp/third_party/zlib-1.3.1/msdos/Makefile.tc | 100 -
cpp/third_party/zlib-1.3.1/nintendods/Makefile | 126 -
cpp/third_party/zlib-1.3.1/nintendods/README | 5 -
cpp/third_party/zlib-1.3.1/old/Makefile.emx | 69 -
cpp/third_party/zlib-1.3.1/old/Makefile.riscos | 151 -
cpp/third_party/zlib-1.3.1/old/README | 3 -
cpp/third_party/zlib-1.3.1/old/descrip.mms | 48 -
cpp/third_party/zlib-1.3.1/old/os2/Makefile.os2 | 136 -
cpp/third_party/zlib-1.3.1/old/os2/zlib.def | 51 -
cpp/third_party/zlib-1.3.1/old/visual-basic.txt | 160 -
cpp/third_party/zlib-1.3.1/os400/README400 | 48 -
cpp/third_party/zlib-1.3.1/os400/bndsrc | 127 -
cpp/third_party/zlib-1.3.1/os400/make.sh | 366 -
cpp/third_party/zlib-1.3.1/os400/zlib.inc | 527 -
cpp/third_party/zlib-1.3.1/qnx/package.qpg | 141 -
cpp/third_party/zlib-1.3.1/test/example.c | 546 -
cpp/third_party/zlib-1.3.1/test/infcover.c | 672 -
cpp/third_party/zlib-1.3.1/test/minigzip.c | 579 -
cpp/third_party/zlib-1.3.1/trees.c | 1117 -
cpp/third_party/zlib-1.3.1/trees.h | 128 -
cpp/third_party/zlib-1.3.1/uncompr.c | 85 -
cpp/third_party/zlib-1.3.1/watcom/watcom_f.mak | 43 -
cpp/third_party/zlib-1.3.1/watcom/watcom_l.mak | 43 -
cpp/third_party/zlib-1.3.1/win32/DLL_FAQ.txt | 381 -
cpp/third_party/zlib-1.3.1/win32/Makefile.bor | 109 -
cpp/third_party/zlib-1.3.1/win32/Makefile.gcc | 177 -
cpp/third_party/zlib-1.3.1/win32/Makefile.msc | 159 -
cpp/third_party/zlib-1.3.1/win32/README-WIN32.txt | 103 -
cpp/third_party/zlib-1.3.1/win32/VisualC.txt | 3 -
cpp/third_party/zlib-1.3.1/win32/zlib.def | 97 -
cpp/third_party/zlib-1.3.1/win32/zlib1.rc | 40 -
cpp/third_party/zlib-1.3.1/zconf.h.cmakein | 545 -
cpp/third_party/zlib-1.3.1/zconf.h.in | 543 -
cpp/third_party/zlib-1.3.1/zlib.3 | 149 -
cpp/third_party/zlib-1.3.1/zlib.3.pdf | Bin 25523 -> 0 bytes
cpp/third_party/zlib-1.3.1/zlib.h | 1938 --
cpp/third_party/zlib-1.3.1/zlib.map | 100 -
cpp/third_party/zlib-1.3.1/zlib.pc.cmakein | 13 -
cpp/third_party/zlib-1.3.1/zlib.pc.in | 13 -
cpp/third_party/zlib-1.3.1/zutil.c | 299 -
cpp/third_party/zlib-1.3.1/zutil.h | 254 -
cpp/tools/CMakeLists.txt | 5 -
cpp/tools/README.md | 16 +-
cpp/tools/format/output_format.cc | 10 +
cpp/tools/skills/tsfile-cli/SKILL.md | 2 -
...eModelEncodingCompressionCompatibilityTest.java | 461 +
python/tsfile/constants.py | 1 +
python/tsfile/tsfile_cpp.pxd | 6 +
python/tsfile/tsfile_py_cpp.pyx | 6 +
2196 files changed, 10630 insertions(+), 1114894 deletions(-)
diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml
index d137d44d4..a494fd78c 100644
--- a/.github/workflows/code-coverage.yml
+++ b/.github/workflows/code-coverage.yml
@@ -34,7 +34,9 @@ jobs:
- name: Generate code coverage reports
run: |
sudo apt-get install lcov
- ./mvnw -B -P with-java,with-cpp,with-code-coverage clean verify -Dspotless.skip=true
+ ./mvnw -B -P with-java,with-cpp,with-code-coverage clean verify \
+ -Denable.lzma2=ON \
+ -Dspotless.skip=true
lcov --capture --directory cpp/target/build/test --output-file cpp/target/build/test/coverage.info
lcov --remove cpp/target/build/test/coverage.info '*/tsfile/cpp/test/*' --output-file cpp/target/build/test/coverage_filtered.info
genhtml cpp/target/build/test/coverage_filtered.info --output-directory cpp/target/build/test/coverage_report
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 3e0bf33a2..28cb4afdc 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -75,7 +75,7 @@ jobs:
- name: Manual build
if: matrix.build-mode == 'manual'
run: |
- .\mvnw.cmd clean package -P with-cpp
+ .\mvnw.cmd clean package -P with-cpp -Denable.lzma2=ON
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4.37.3
diff --git a/.github/workflows/compatibility-test.yml b/.github/workflows/compatibility-test.yml
new file mode 100644
index 000000000..0d21c2694
--- /dev/null
+++ b/.github/workflows/compatibility-test.yml
@@ -0,0 +1,222 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Compatibility-Test
+
+on:
+ push:
+ branches:
+ - develop
+ - iotdb
+ - rc/*
+ paths:
+ - '.github/workflows/compatibility-test.yml'
+ - '.mvn/**'
+ - 'cpp/**'
+ - 'java/**'
+ - 'mvnw'
+ - 'pom.xml'
+ pull_request:
+ branches:
+ - develop
+ - dev/*
+ - iotdb
+ - rc/*
+ paths:
+ - '.github/workflows/compatibility-test.yml'
+ - '.mvn/**'
+ - 'cpp/**'
+ - 'java/**'
+ - 'mvnw'
+ - 'pom.xml'
+ workflow_dispatch:
+ inputs:
+ forceUpdates:
+ description: "Forces a snapshot update"
+ required: false
+ default: 'false'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+env:
+ MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
+ DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
+
+jobs:
+ generate-fixtures:
+ name: Generate ${{ matrix.language }} fixtures
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ java, cpp ]
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v5.6.0
+ with:
+ distribution: corretto
+ java-version: 17
+
+ - name: Cache Maven packages
+ uses: actions/cache@v6
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2-
+
+ - name: Cache verified C++ dependency archives
+ if: matrix.language == 'cpp'
+ uses: actions/cache@v6
+ with:
+ path: cpp/target/dependency-cache
+ key: ${{ runner.os }}-tsfile-cpp-deps-${{ hashFiles('cpp/CMakeLists.txt', 'cpp/cmake/*Source.cmake', 'cpp/third_party/CMakeLists.txt') }}
+
+ - name: Generate Java table fixtures
+ if: matrix.language == 'java'
+ shell: bash
+ run: |
+ mkdir -p compat-fixtures/java
+ ./mvnw -P with-java \
+ -Dtest=TableModelEncodingCompressionCompatibilityTest#generateFixtures \
+ -Dsurefire.failIfNoSpecifiedTests=false \
+ -Dtsfile.compat.generate.dir="$PWD/compat-fixtures/java" \
+ test
+
+ - name: Build C++ tests
+ if: matrix.language == 'cpp'
+ shell: bash
+ run: |
+ ./mvnw -P with-cpp \
+ -Dbuild.type=Release \
+ -DskipTests \
+ -Dspotless.skip=true \
+ -Dtsfile.dependency.source=BUNDLED \
+ -Denable.antlr4=OFF \
+ -Denable.snappy=OFF \
+ -Denable.lz4=ON \
+ -Denable.lzokay=OFF \
+ -Denable.zlib=OFF \
+ -Denable.zstd=ON \
+ -Denable.lzma2=ON \
+ -Denable.simd=OFF \
+ package
+
+ - name: Generate C++ table fixtures
+ if: matrix.language == 'cpp'
+ shell: bash
+ run: |
+ mkdir -p compat-fixtures/cpp
+ TSFILE_COMPAT_GENERATE_DIR="$PWD/compat-fixtures/cpp" \
+ ./cpp/target/build/test/lib/TsFile_Test \
+ --gtest_filter=TableModelEncodingCompressionCompatibilityTest.GenerateFixtures
+
+ - name: Upload ${{ matrix.language }} fixtures
+ uses: actions/upload-artifact@v7
+ with:
+ name: tsfile-${{ matrix.language }}-compat-fixtures
+ path: compat-fixtures/${{ matrix.language }}/
+ if-no-files-found: error
+ retention-days: 1
+
+ validate-fixtures:
+ name: Validate ${{ matrix.writer }} fixtures with ${{ matrix.reader }}
+ needs: generate-fixtures
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - writer: java
+ reader: cpp
+ - writer: cpp
+ reader: java
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v5.6.0
+ with:
+ distribution: corretto
+ java-version: 17
+
+ - name: Cache Maven packages
+ uses: actions/cache@v6
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2-
+
+ - name: Cache verified C++ dependency archives
+ if: matrix.reader == 'cpp'
+ uses: actions/cache@v6
+ with:
+ path: cpp/target/dependency-cache
+ key: ${{ runner.os }}-tsfile-cpp-deps-${{ hashFiles('cpp/CMakeLists.txt', 'cpp/cmake/*Source.cmake', 'cpp/third_party/CMakeLists.txt') }}
+
+ - name: Download ${{ matrix.writer }} fixtures
+ uses: actions/download-artifact@v8
+ with:
+ name: tsfile-${{ matrix.writer }}-compat-fixtures
+ path: compat-fixtures/${{ matrix.writer }}
+
+ - name: Validate ${{ matrix.writer }} fixtures with Java
+ if: matrix.reader == 'java'
+ shell: bash
+ run: |
+ ./mvnw -P with-java \
+ -Dtest=TableModelEncodingCompressionCompatibilityTest#validateFixtures \
+ -Dsurefire.failIfNoSpecifiedTests=false \
+ -Dtsfile.compat.validate.dir="$PWD/compat-fixtures/${{ matrix.writer }}" \
+ test
+
+ - name: Build C++ tests
+ if: matrix.reader == 'cpp'
+ shell: bash
+ run: |
+ ./mvnw -P with-cpp \
+ -Dbuild.type=Release \
+ -DskipTests \
+ -Dspotless.skip=true \
+ -Dtsfile.dependency.source=BUNDLED \
+ -Denable.antlr4=OFF \
+ -Denable.snappy=OFF \
+ -Denable.lz4=ON \
+ -Denable.lzokay=OFF \
+ -Denable.zlib=OFF \
+ -Denable.zstd=ON \
+ -Denable.lzma2=ON \
+ -Denable.simd=OFF \
+ package
+
+ - name: Validate ${{ matrix.writer }} fixtures with C++
+ if: matrix.reader == 'cpp'
+ shell: bash
+ run: |
+ TSFILE_COMPAT_VALIDATE_DIR="$PWD/compat-fixtures/${{ matrix.writer }}" \
+ ./cpp/target/build/test/lib/TsFile_Test \
+ --gtest_filter=TableModelEncodingCompressionCompatibilityTest.ValidateFixtures
diff --git a/.github/workflows/cpp-dependency-source.yml b/.github/workflows/cpp-dependency-source.yml
new file mode 100644
index 000000000..72d977ba8
--- /dev/null
+++ b/.github/workflows/cpp-dependency-source.yml
@@ -0,0 +1,365 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Cpp-Dependency-Source
+
+on:
+ push:
+ branches:
+ - develop
+ - iotdb
+ - rc/*
+ paths:
+ - '.github/workflows/cpp-dependency-source.yml'
+ - 'cpp/**'
+ - 'pom.xml'
+ pull_request:
+ branches:
+ - develop
+ - dev/*
+ - iotdb
+ - rc/*
+ paths:
+ - '.github/workflows/cpp-dependency-source.yml'
+ - 'cpp/**'
+ - 'pom.xml'
+ workflow_dispatch:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+env:
+ TSFILE_BUILD_DIR: cpp/target/dependency-source-build
+ TSFILE_DEPENDENCY_CACHE: cpp/target/dependency-source-cache
+
+jobs:
+ legacy-cmake:
+ name: Legacy core build with CMake 3.11
+ runs-on: ubuntu-22.04
+ timeout-minutes: 20
+ env:
+ CMAKE_3_11_VERSION: 3.11.4
+ CMAKE_3_11_SHA256: 6dab016a6b82082b8bcd0f4d1e53418d6372015dd983d29367b9153f1a376435
+ XZ_VERSION: 5.8.3
+ XZ_SHA256: 3d3a1b973af218114f4f889bbaa2f4c037deaae0c8e815eec381c3d546b974a0
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+
+ - name: Install verified CMake 3.11
+ shell: bash
+ run: |
+ curl --fail --location --retry 3 \
+ "https://cmake.org/files/v3.11/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64.tar.gz" \
+ --output cmake-3.11.tar.gz
+ echo "${CMAKE_3_11_SHA256} cmake-3.11.tar.gz" | sha256sum --check
+ tar -xzf cmake-3.11.tar.gz
+
+ - name: Configure the legacy core with default LZMA2 setting
+ shell: bash
+ run: |
+ mkdir -p "$TSFILE_BUILD_DIR"
+ cd "$TSFILE_BUILD_DIR"
+ "$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
+ "$GITHUB_WORKSPACE/cpp" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_TEST=OFF \
+ -DBUILD_TOOLS=OFF \
+ -DENABLE_ANTLR4=OFF \
+ -DENABLE_SNAPPY=OFF \
+ -DENABLE_LZ4=OFF \
+ -DENABLE_LZOKAY=OFF \
+ -DENABLE_ZLIB=OFF \
+ -DENABLE_ZSTD=OFF \
+ -DENABLE_SIMD=OFF
+ grep -Fx "ENABLE_LZMA2:BOOL=OFF" CMakeCache.txt
+ ! grep -q '^TSFILE_LIBLZMA' CMakeCache.txt
+
+ - name: Build TsFile with CMake 3.11
+ shell: bash
+ run: |
+ cd "$TSFILE_BUILD_DIR"
+ "$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
+ --build . --target tsfile -- -j2
+
+ - name: Install an external liblzma for the legacy SYSTEM build
+ shell: bash
+ run: |
+ curl --fail --location --retry 3 \
+ "https://github.com/tukaani-project/xz/releases/download/v${XZ_VERSION}/xz-${XZ_VERSION}.tar.gz" \
+ --output xz.tar.gz
+ echo "${XZ_SHA256} xz.tar.gz" | sha256sum --check
+ tar -xzf xz.tar.gz
+ cd "xz-${XZ_VERSION}"
+ ./configure \
+ --prefix="$GITHUB_WORKSPACE/system-liblzma" \
+ --disable-static \
+ --disable-xz \
+ --disable-xzdec \
+ --disable-lzmadec \
+ --disable-lzmainfo \
+ --disable-lzma-links \
+ --disable-scripts \
+ --disable-doc \
+ --disable-nls
+ make -j2
+ make install
+
+ - name: Build LZMA2 against SYSTEM liblzma with CMake 3.11
+ shell: bash
+ run: |
+ mkdir -p "${TSFILE_BUILD_DIR}-lzma2-system"
+ cd "${TSFILE_BUILD_DIR}-lzma2-system"
+ "$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
+ "$GITHUB_WORKSPACE/cpp" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/system-liblzma" \
+ -DBUILD_TEST=OFF \
+ -DBUILD_TOOLS=OFF \
+ -DENABLE_ANTLR4=OFF \
+ -DENABLE_SNAPPY=OFF \
+ -DENABLE_LZ4=OFF \
+ -DENABLE_LZOKAY=OFF \
+ -DENABLE_ZLIB=OFF \
+ -DENABLE_ZSTD=OFF \
+ -DENABLE_LZMA2=ON \
+ -DENABLE_SIMD=OFF \
+ -DTSFILE_DEPENDENCY_SOURCE=SYSTEM \
+ 2>&1 | tee configure.log
+ grep -F "TsFile dependency liblzma: SYSTEM" configure.log
+ "$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
+ --build . --target tsfile -- -j2
+
+ - name: Reject bundled LZMA2 with CMake 3.11 clearly
+ shell: bash
+ run: |
+ mkdir -p "${TSFILE_BUILD_DIR}-lzma2-bundled-rejected"
+ cd "${TSFILE_BUILD_DIR}-lzma2-bundled-rejected"
+ if "$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
+ "$GITHUB_WORKSPACE/cpp" \
+ -DBUILD_TEST=OFF \
+ -DBUILD_TOOLS=OFF \
+ -DENABLE_ANTLR4=OFF \
+ -DENABLE_SNAPPY=OFF \
+ -DENABLE_LZ4=OFF \
+ -DENABLE_LZOKAY=OFF \
+ -DENABLE_ZLIB=OFF \
+ -DENABLE_ZSTD=OFF \
+ -DENABLE_LZMA2=ON \
+ -DENABLE_SIMD=OFF \
+ -DTSFILE_DEPENDENCY_SOURCE=BUNDLED \
+ > configure.log 2>&1; then
+ echo "Bundled LZMA2 unexpectedly configured with CMake 3.11."
+ exit 1
+ fi
+ cat configure.log
+ # CMake wraps long FATAL_ERROR messages, so match short fragments
+ # instead of assuming the complete sentence remains on one line.
+ grep -F "XZ Utils 5.8.3" configure.log
+ grep -F "CMake 3.20 or newer" configure.log
+
+ bundled:
+ name: BUNDLED from a fresh archive cache
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+
+ - name: Install bundled build prerequisites
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y uuid-dev
+
+ - name: Configure all dependencies from verified archives
+ shell: bash
+ run: |
+ cmake -S cpp -B "$TSFILE_BUILD_DIR" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_TEST=OFF \
+ -DBUILD_TOOLS=OFF \
+ -DENABLE_LZMA2=ON \
+ -DTSFILE_DEPENDENCY_SOURCE=BUNDLED \
+ -DTSFILE_DEPENDENCY_CACHE="$GITHUB_WORKSPACE/$TSFILE_DEPENDENCY_CACHE" \
+ 2>&1 | tee bundled-configure.log
+
+ for dependency in ANTLR4 Snappy LZ4 lzokay zlib Zstandard liblzma SIMDe; do
+ grep -F "TsFile dependency ${dependency}: BUNDLED" bundled-configure.log
+ done
+
+ - name: Build TsFile with bundled dependencies
+ run: cmake --build "$TSFILE_BUILD_DIR" --target tsfile --parallel 2
+
+ - name: Upload verified dependency archives
+ uses: actions/upload-artifact@v7
+ with:
+ name: tsfile-cpp-dependency-archives
+ path: ${{ env.TSFILE_DEPENDENCY_CACHE }}/
+ if-no-files-found: error
+ retention-days: 1
+
+ offline:
+ name: BUNDLED from cache with network downloads disabled
+ needs: bundled
+ runs-on: ubuntu-latest
+ timeout-minutes: 30
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+
+ - name: Download verified dependency archives
+ uses: actions/download-artifact@v8
+ with:
+ name: tsfile-cpp-dependency-archives
+ path: ${{ env.TSFILE_DEPENDENCY_CACHE }}
+
+ - name: Install offline build prerequisites
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y uuid-dev
+
+ - name: Configure all dependencies offline
+ shell: bash
+ run: |
+ cmake -S cpp -B "$TSFILE_BUILD_DIR" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DBUILD_TEST=OFF \
+ -DBUILD_TOOLS=OFF \
+ -DENABLE_LZMA2=ON \
+ -DTSFILE_DEPENDENCY_SOURCE=BUNDLED \
+ -DTSFILE_DEPENDENCY_OFFLINE=ON \
+ -DTSFILE_DEPENDENCY_CACHE="$GITHUB_WORKSPACE/$TSFILE_DEPENDENCY_CACHE" \
+ 2>&1 | tee offline-configure.log
+
+ for dependency in ANTLR4 Snappy LZ4 lzokay zlib Zstandard liblzma SIMDe; do
+ grep -F "TsFile dependency ${dependency}: BUNDLED" offline-configure.log
+ done
+
+ - name: Build TsFile offline
+ run: cmake --build "$TSFILE_BUILD_DIR" --target tsfile --parallel 2
+
+ system:
+ name: SYSTEM from an external package prefix
+ runs-on: ubuntu-24.04
+ timeout-minutes: 45
+ env:
+ VCPKG_COMMIT: a2b75031b909a2d6b051725c3909230c72d4bd4a
+ VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/.vcpkg-binary-cache
+ ANTLR4_VERSION: 4.9.3
+ ANTLR4_SHA256: efe4057d75ab48145d4683100fec7f77d7f87fa258707330cadd1f8e6f7eecae
+ SIMDE_VERSION: 0.8.4-rc3
+ SIMDE_SHA256: a5407985439fef1435ac1f091a4d2e6c71981faed213e1be156aca575ce7052c
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v7
+
+ - name: Checkout pinned vcpkg registry
+ uses: actions/checkout@v7
+ with:
+ repository: microsoft/vcpkg
+ ref: ${{ env.VCPKG_COMMIT }}
+ path: vcpkg
+
+ - name: Cache vcpkg binary packages
+ uses: actions/cache@v6
+ with:
+ path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
+ key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_COMMIT }}-tsfile-system-v2
+
+ - name: Install external build prerequisites
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y cmake libutfcpp-dev pkg-config uuid-dev
+
+ - name: Install external vcpkg dependencies
+ shell: bash
+ run: |
+ mkdir -p "$VCPKG_DEFAULT_BINARY_CACHE"
+ ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
+ ./vcpkg/vcpkg install \
+ snappy:x64-linux \
+ lz4:x64-linux \
+ lzokay:x64-linux \
+ zlib:x64-linux \
+ zstd:x64-linux \
+ liblzma:x64-linux \
+ --clean-after-build
+
+ # ANTLR4 4.10 and later require C++17, while TsFile currently targets
+ # C++11. Build the compatible 4.9.3 runtime into the external prefix with
+ # Ubuntu's distro CMake; CMake 4 no longer accepts its legacy policies.
+ - name: Install external ANTLR4 runtime
+ shell: bash
+ run: |
+ mkdir -p system-prefix
+ curl --fail --location --retry 3 \
+ "https://github.com/antlr/antlr4/archive/refs/tags/${ANTLR4_VERSION}.tar.gz" \
+ --output antlr4.tar.gz
+ echo "${ANTLR4_SHA256} antlr4.tar.gz" | sha256sum --check
+ tar -xzf antlr4.tar.gz
+ /usr/bin/cmake \
+ -S "antlr4-${ANTLR4_VERSION}/runtime/Cpp" \
+ -B antlr4-build \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/system-prefix" \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
+ -DANTLR4_INSTALL=ON \
+ -DWITH_DEMO=OFF
+ /usr/bin/cmake --build antlr4-build \
+ --target install --parallel 2
+
+ # vcpkg currently provides SIMDe 0.8.2, which is below TsFile's 0.8.4
+ # minimum. Install the verified upstream headers into a separate external
+ # prefix so SYSTEM mode still validates SIMD support.
+ - name: Install external SIMDe headers
+ shell: bash
+ run: |
+ mkdir -p system-prefix/include
+ curl --fail --location --retry 3 \
+ "https://github.com/simd-everywhere/simde/archive/refs/tags/v${SIMDE_VERSION}.tar.gz" \
+ --output simde.tar.gz
+ echo "${SIMDE_SHA256} simde.tar.gz" | sha256sum --check
+ tar -xzf simde.tar.gz
+ cmake -E copy_directory \
+ "simde-${SIMDE_VERSION}/simde" \
+ system-prefix/include/simde
+
+ - name: Configure all dependencies from the system prefix
+ shell: bash
+ run: |
+ cmake -S cpp -B "$TSFILE_BUILD_DIR" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake" \
+ -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/system-prefix" \
+ -Dantlr4-runtime_DIR="$GITHUB_WORKSPACE/system-prefix/lib/cmake/antlr4-runtime" \
+ -DSIMDE_ROOT="$GITHUB_WORKSPACE/system-prefix" \
+ -DBUILD_TEST=OFF \
+ -DBUILD_TOOLS=OFF \
+ -DENABLE_LZMA2=ON \
+ -DTSFILE_DEPENDENCY_SOURCE=SYSTEM \
+ 2>&1 | tee system-configure.log
+
+ for dependency in ANTLR4 Snappy LZ4 lzokay zlib Zstandard liblzma SIMDe; do
+ grep -F "TsFile dependency ${dependency}: SYSTEM" system-configure.log
+ done
+
+ - name: Build TsFile with system dependencies
+ run: cmake --build "$TSFILE_BUILD_DIR" --target tsfile --parallel 2
diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml
index 5676a965c..513048d44 100644
--- a/.github/workflows/cppcheck.yml
+++ b/.github/workflows/cppcheck.yml
@@ -125,6 +125,7 @@ jobs:
run: |
./mvnw -P with-cpp,with-cppcheck -pl cpp \
-Dbuild.test=OFF \
+ -Denable.lzma2=ON \
cmake:generate@cmake-generate-test-compile
test -s cpp/target/build/compile_commands.json
diff --git a/.github/workflows/unit-test-cpp-msvc.yml b/.github/workflows/unit-test-cpp-msvc.yml
index f694b06b0..d00d9aee8 100644
--- a/.github/workflows/unit-test-cpp-msvc.yml
+++ b/.github/workflows/unit-test-cpp-msvc.yml
@@ -156,5 +156,7 @@ jobs:
$TOOLSET_ARG \
-Denable.asan=$ASAN_VALUE \
-Dbuild.type=${{ matrix.build_type }} \
+ -Denable.lzma2=ON \
+ -Dtsfile.dependency.source=BUNDLED \
-Dspotless.skip=true \
clean verify
diff --git a/.github/workflows/unit-test-cpp.yml b/.github/workflows/unit-test-cpp.yml
index b3d6f31bb..982f327c3 100644
--- a/.github/workflows/unit-test-cpp.yml
+++ b/.github/workflows/unit-test-cpp.yml
@@ -147,5 +147,8 @@ jobs:
export PATH="/c/mingw64/bin:$PATH"
fi
./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} -P with-cpp \
- -Denable.asan=$ASAN_VALUE -Dbuild.type=${{ matrix.build_type }} clean verify
-
+ -Denable.asan=$ASAN_VALUE \
+ -Dbuild.type=${{ matrix.build_type }} \
+ -Denable.lzma2=ON \
+ -Dtsfile.dependency.source=BUNDLED \
+ clean verify
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index d64d48c4a..d95e58edf 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -96,6 +96,7 @@ jobs:
./mvnw -Pwith-cpp clean package \
-DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true \
-Dbuild.test=OFF \
+ -Denable.lzma2=ON \
-Dcmake.args="-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0"
otool -l cpp/target/build/lib/libtsfile*.dylib | grep -A2 LC_VERSION_MIN_MACOSX || true
@@ -137,6 +138,7 @@ jobs:
chmod +x mvnw || true
./mvnw -Pwith-cpp clean package \
-DskipTests -Dbuild.test=OFF \
+ -Denable.lzma2=ON \
-Dspotless.check.skip=true -Dspotless.apply.skip=true
test -d cpp/target/build/lib && test -d cpp/target/build/include
@@ -203,6 +205,7 @@ jobs:
chmod +x mvnw || true
./mvnw -Pwith-cpp clean package \
-DskipTests -Dbuild.test=OFF \
+ -Denable.lzma2=ON \
-Dspotless.check.skip=true -Dspotless.apply.skip=true
test -d cpp/target/build/lib
test -d cpp/target/build/include
diff --git a/LICENSE b/LICENSE
index 2b867a613..91642d2c2 100644
--- a/LICENSE
+++ b/LICENSE
@@ -257,44 +257,302 @@ License: https://github.com/trinodb/trino/blob/master/LICENSE
--------------------------------------------------------------------------------
-The following files include code is copied from lz4 project.
+When the C++ build uses the TsFile-managed ANTLR4 source, the library includes
+code downloaded from the verified ANTLR4 4.9.3 tag source archive and modified
+by the documented TsFile compatibility patch set during configuration.
+
+Project page: https://github.com/antlr/antlr4
+Source archive: https://github.com/antlr/antlr4/archive/refs/tags/4.9.3.tar.gz
+SHA-256: efe4057d75ab48145d4683100fec7f77d7f87fa258707330cadd1f8e6f7eecae
+
+[The "BSD 3-clause license"]
+Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=====
+
+MIT License for codepointat.js from https://git.io/codepointat
+MIT License for fromcodepoint.js from https://git.io/vDW1m
+
+Copyright Mathias Bynens <https://mathiasbynens.be/>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-./cpp/src/compress/lz4.c
-./cpp/src/compress/lz4.h
+--------------------------------------------------------------------------------
-Copyright: (C) 2011-2020, Yann Collet.
-Project page: http://www.lz4.org
-License: https://github.com/lz4/lz4/blob/dev/LICENSE
+The TsFile-managed ANTLR4 build also includes utf8cpp headers downloaded from
+the verified upstream v3.1.1 tag source archive.
+
+Project page: https://github.com/nemtrif/utfcpp
+Source archive: https://github.com/nemtrif/utfcpp/archive/refs/tags/v3.1.1.tar.gz
+SHA-256: 33496a4c3cc2de80e9809c4997052331af5fb32079f43ab4d667cd48c3a36e88
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
-The following files include code modified from Snappy project.
+When the C++ build uses the TsFile-managed LZ4 source, the library includes
+code downloaded from the verified LZ4 v1.9.4 tag source archive.
+
+Project page: https://github.com/lz4/lz4
+Source archive: https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz
+SHA-256: 0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b
+
+LZ4 Library
+Copyright (c) 2011-2020, Yann Collet
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
-./cpp/third_party/google_snappy/snappy.h
-./cpp/third_party/google_snappy/snappy.cc
-./cpp/third_party/google_snappy/snappy-internal.h
-./cpp/third_party/google_snappy/snappy-sinksource.cc
-./cpp/third_party/google_snappy/snappy-sinksource.h
-./cpp/third_party/google_snappy/snappy-stubs-internal.cc
-./cpp/third_party/google_snappy/snappy-stubs-internal.h
-./cpp/third_party/google_snappy/snappy-stubs-public.h.in
-./cpp/third_party/google_snappy/CMakeLists.txt
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------------------
+
+When the C++ build uses the TsFile-managed Snappy source, the library includes
+code downloaded from the verified upstream tag 1.2.2.
-Copyright: 2011, Google Inc.
Project page: https://github.com/google/snappy
-License: https://github.com/google/snappy/blob/main/COPYING
+Source archive: https://github.com/google/snappy/archive/refs/tags/1.2.2.tar.gz
+SHA-256: 90f74bc1fbf78a6c56b3c4a082a05103b3a56bb17bca1a27e052ea11723292dc
+
+Copyright 2011, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------------------
+
+When the C++ build uses the TsFile-managed Zstandard source, the library
+includes code downloaded from the verified upstream v1.5.7 tag archive. The
+BSD-3-Clause option is selected from Zstandard's BSD-3-Clause OR GPLv2 dual
+license.
+
+Project page: https://github.com/facebook/zstd
+Source archive: https://github.com/facebook/zstd/archive/refs/tags/v1.5.7.tar.gz
+SHA-256: 37d7284556b20954e56e1ca85b80226768902e2edabd3b649e9e72c0c9012ee3
+
+BSD License
+
+For Zstandard software
+
+Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name Facebook, nor Meta, nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
-The following files include code is copied from lzokay project.
+When the C++ build uses the TsFile-managed liblzma source, the resulting target
+includes only 0BSD-licensed liblzma code from the verified XZ Utils v5.8.3
+release archive. The upstream archive is a mixed-license distribution; its
+GPL-licensed scripts and LGPL-licensed GNU getopt replacement are not compiled,
+linked, installed, or redistributed by TsFile.
+
+Project page: https://github.com/tukaani-project/xz
+Source archive: https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz
+SHA-256: 3d3a1b973af218114f4f889bbaa2f4c037deaae0c8e815eec381c3d546b974a0
-./cpp/third_party/lzokay/lzokay.cpp
-./cpp/third_party/lzokay/lzokay.hpp
-./cpp/third_party/lzokay/LICENSE
+BSD Zero Clause License
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+--------------------------------------------------------------------------------
+
+When the C++ build uses the TsFile-managed lzokay source, the library includes
+code downloaded from the verified upstream commit
+5cb18da508cc4d3ec41bc04dccdeef9c5ffedfb2.
-Copyright: (c) 2018 Jack Andersen
Project page: https://github.com/AxioDL/lzokay
-License: https://github.com/AxioDL/lzokay/blob/master/LICENSE
+Source archive: https://github.com/AxioDL/lzokay/archive/5cb18da508cc4d3ec41bc04dccdeef9c5ffedfb2.tar.gz
+SHA-256: eb518bf793da0b4420a3ffdf1511851575bc62ef350b303f14ff7355f370da6a
+
+The MIT License
+
+Copyright (c) 2018 Jack Andersen
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+--------------------------------------------------------------------------------
+
+When the C++ build uses the TsFile-managed zlib source, the library includes
+code downloaded from the verified zlib v1.3.1 tag source archive.
+
+Project page: https://github.com/madler/zlib
+Source archive: https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz
+SHA-256: 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c
+
+Copyright notice:
+
+ (C) 1995-2022 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
--------------------------------------------------------------------------------
@@ -338,13 +596,33 @@ License: https://github.com/apache/commons-collections/blob/master/LICENSE.txt
--------------------------------------------------------------------------------
-The following files include code from SIMDe (SIMD Everywhere) project.
-
-./cpp/third_party/simde-0.8.4-rc3/
+When the C++ build uses the TsFile-managed SIMDe source, the library includes
+headers downloaded from the verified SIMDe v0.8.4-rc3 tag source archive.
-Copyright: (c) 2017 Evan Nemerson <ev...@nemerson.com>
Project page: https://github.com/simd-everywhere/simde
-License: https://github.com/simd-everywhere/simde/blob/master/COPYING (MIT)
+Source archive: https://github.com/simd-everywhere/simde/archive/refs/tags/v0.8.4-rc3.tar.gz
+SHA-256: a5407985439fef1435ac1f091a4d2e6c71981faed213e1be156aca575ce7052c
+
+Copyright (c) 2017 Evan Nemerson <ev...@nemerson.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 0810a509f..a5a5bea88 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
Apache TsFile
-Copyright 2023-2025 The Apache Software Foundation.
+Copyright 2023-2026 The Apache Software Foundation.
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
diff --git a/cpp/CLAUDE.md b/cpp/CLAUDE.md
index 5ae5bbd2e..02dc4186e 100644
--- a/cpp/CLAUDE.md
+++ b/cpp/CLAUDE.md
@@ -36,7 +36,11 @@ bash build.sh -a=ON # Enable AddressSanitizer
bash build.sh -c=ON # Enable code coverage
# Disable optional compression libraries
-bash build.sh --disable-snappy --disable-lz4 --disable-lzokay --disable-zlib
+bash build.sh --disable-snappy --disable-lz4 --disable-lzokay --disable-zlib \
+ --disable-zstd --disable-lzma2
+
+# LZMA2 is opt-in; its bundled XZ build requires CMake 3.20+
+bash build.sh --enable-lzma2=ON
# Or use CMake directly
mkdir -p build/Release && cd build/Release
@@ -61,7 +65,8 @@ All `ON` by default unless noted:
|--------|---------|
| `BUILD_TEST` | Compile tests (GTest 1.12.1, auto-downloaded) |
| `ENABLE_ANTLR4` | ANTLR4 parser runtime |
-| `ENABLE_SNAPPY` / `ENABLE_LZ4` / `ENABLE_LZOKAY` / `ENABLE_ZLIB` | Compression libraries |
+| `ENABLE_SNAPPY` / `ENABLE_LZ4` / `ENABLE_LZOKAY` / `ENABLE_ZLIB` / `ENABLE_ZSTD` | Compression libraries |
+| `ENABLE_LZMA2` | LZMA2 compression (`OFF` by default; bundled XZ requires CMake 3.20+) |
| `ENABLE_THREADS` | Multi-threaded read/write via pthreads |
| `ENABLE_ASAN` | AddressSanitizer (`OFF` by default) |
| `ENABLE_SIMD` | SIMD acceleration |
@@ -83,10 +88,13 @@ cpp/src/
## Architecture Notes
-- **C++11** standard, targets CMake 3.11+
+- **C++11** standard, targets CMake 3.11+; bundled XZ/LZMA2 requires CMake
+ 3.20+, while older CMake can enable LZMA2 with a compatible system liblzma
- Dual data model: **tree-view** (`TsFileTreeWriter/Reader`) and **table-view** (`TsFileTableWriter`, `TableQueryExecutor`)
- Parallel column encoding in table write path, controlled by `ENABLE_THREADS`
-- Third-party libraries are bundled under `third_party/` (ANTLR4, Snappy, LZ4, LZOKAY, Zlib, SIMDe)
+- Third-party dependencies are either retained under `third_party/` or resolved
+ from compatible system packages and verified source archives; see
+ `third_party/README.md`.
- `cwrapper/` provides the C API that the Python module binds to via Cython
## Code Style
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 440c6cbfb..7ff07a786 100755
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -29,8 +29,14 @@ endif ()
if (POLICY CMP0079)
cmake_policy(SET CMP0079 NEW)
endif ()
+if (POLICY CMP0074)
+ cmake_policy(SET CMP0074 NEW)
+endif ()
set(TsFile_CPP_VERSION 2.3.2.dev)
+include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/DependencySource.cmake)
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
option(TSFILE_BUILD_SHARED "Build libtsfile as a shared library" ON)
message("cmake using: TSFILE_BUILD_SHARED=${TSFILE_BUILD_SHARED}")
@@ -226,11 +232,16 @@ message("cmake using: BUILD_TOOLS=${BUILD_TOOLS}")
option(ENABLE_ANTLR4 "Enable ANTLR4 runtime" ON)
message("cmake using: ENABLE_ANTLR4=${ENABLE_ANTLR4}")
+if (ENABLE_ANTLR4)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ANTLR4Dependency.cmake)
+endif ()
+
option(ENABLE_SNAPPY "Enable Google Snappy compression" ON)
message("cmake using: ENABLE_SNAPPY=${ENABLE_SNAPPY}")
if (ENABLE_SNAPPY)
add_definitions(-DENABLE_SNAPPY)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/SnappyDependency.cmake)
endif()
option(ENABLE_LZ4 "Enable LZ4 compression" ON)
@@ -238,6 +249,7 @@ message("cmake using: ENABLE_LZ4=${ENABLE_LZ4}")
if (ENABLE_LZ4)
add_definitions(-DENABLE_LZ4)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LZ4Dependency.cmake)
endif()
option(ENABLE_LZOKAY "Enable LZOKAY compression" ON)
@@ -245,6 +257,7 @@ message("cmake using: ENABLE_LZOKAY=${ENABLE_LZOKAY}")
if (ENABLE_LZOKAY)
add_definitions(-DENABLE_LZOKAY)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LZOKAYDependency.cmake)
endif()
option(ENABLE_ZLIB "Enable Zlib compression" ON)
@@ -253,8 +266,37 @@ message("cmake using: ENABLE_ZLIB=${ENABLE_ZLIB}")
if (ENABLE_ZLIB)
add_definitions(-DENABLE_ZLIB)
add_definitions(-DENABLE_GZIP)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ZLIBDependency.cmake)
endif()
+option(ENABLE_ZSTD "Enable Zstandard compression" ON)
+message("cmake using: ENABLE_ZSTD=${ENABLE_ZSTD}")
+
+if (ENABLE_ZSTD)
+ add_definitions(-DENABLE_ZSTD)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ZSTDDependency.cmake)
+endif ()
+
+# LZMA2 is opt-in so this optional codec does not raise the CMake 3.11 baseline
+# used by long-lived industrial and legacy toolchains. The verified bundled XZ
+# Utils 5.8.3 build requires CMake 3.20 or newer; older CMake versions may still
+# enable LZMA2 when a compatible system liblzma package is available.
+option(ENABLE_LZMA2
+ "Enable LZMA2 compression (bundled liblzma requires CMake 3.20+)"
+ OFF)
+message("cmake using: ENABLE_LZMA2=${ENABLE_LZMA2}")
+
+if (ENABLE_LZMA2)
+ add_definitions(-DENABLE_LZMA2)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibLZMADependency.cmake)
+else ()
+ message(STATUS
+ "LZMA2 is disabled. It defaults to OFF so this optional codec "
+ "does not raise the build-system floor for legacy toolchains; "
+ "enable it explicitly with a compatible system liblzma or "
+ "with bundled XZ Utils on CMake 3.20+.")
+endif ()
+
option(ENABLE_THREADS "Enable multi-threaded read/write (requires pthreads)" ON)
message("cmake using: ENABLE_THREADS=${ENABLE_THREADS}")
@@ -269,11 +311,7 @@ message("cmake using: ENABLE_SIMD=${ENABLE_SIMD}")
if (ENABLE_SIMD)
add_definitions(-DENABLE_SIMD)
- # common/statistic.h is a public header included by src, tools, tests and
- # the cwrapper; under ENABLE_SIMD it pulls in <simde/x86/sse4.2.h>. Add the
- # SIMDe include path here (before every add_subdirectory below) so all
- # targets inherit it, instead of repeating it per subdirectory.
- include_directories(${CMAKE_SOURCE_DIR}/third_party/simde-0.8.4-rc3)
+ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/SIMDeDependency.cmake)
endif()
# All libs will be stored here, including libtsfile, compress-encoding lib.
@@ -299,11 +337,58 @@ else ()
endif ()
add_subdirectory(third_party)
+# CMake 3.11 cannot call target_link_libraries() on object-library targets, but
+# directory-level link_libraries() initializes both their usage requirements
+# and the final library's link dependencies. Apply every enabled project
+# dependency before creating the object libraries below. The test target links
+# these dependencies explicitly, so temporarily restore the original directory
+# property while configuring downloaded GoogleTest targets.
+set(_TSFILE_PROJECT_DEPENDENCIES "")
+if (ENABLE_ANTLR4)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::ANTLR4)
+endif ()
+if (ENABLE_SNAPPY)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::Snappy)
+endif ()
+if (ENABLE_LZ4)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::LZ4)
+endif ()
+if (ENABLE_LZOKAY)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::LZOKAY)
+endif ()
+if (ENABLE_ZLIB)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::ZLIB)
+endif ()
+if (ENABLE_ZSTD)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::ZSTD)
+endif ()
+if (ENABLE_LZMA2)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::LibLZMA)
+endif ()
+if (ENABLE_SIMD)
+ list(APPEND _TSFILE_PROJECT_DEPENDENCIES TsFile::SIMDe)
+endif ()
+
+if (NOT "${_TSFILE_PROJECT_DEPENDENCIES}" STREQUAL "")
+ get_property(_TSFILE_BASE_LINK_LIBRARIES
+ DIRECTORY PROPERTY LINK_LIBRARIES)
+ link_libraries(${_TSFILE_PROJECT_DEPENDENCIES})
+ get_property(_TSFILE_PROJECT_LINK_LIBRARIES
+ DIRECTORY PROPERTY LINK_LIBRARIES)
+endif ()
+
add_subdirectory(src)
if (BUILD_TOOLS)
add_subdirectory(tools)
endif ()
if (BUILD_TEST)
+ # The test target links project dependencies explicitly. Do not make
+ # downloaded GoogleTest targets inherit them, because their upstream
+ # install export cannot export TsFile-owned targets.
+ if (NOT "${_TSFILE_PROJECT_DEPENDENCIES}" STREQUAL "")
+ set_property(DIRECTORY PROPERTY LINK_LIBRARIES
+ "${_TSFILE_BASE_LINK_LIBRARIES}")
+ endif ()
add_subdirectory(test)
if (TESTS_ENABLED)
add_dependencies(TsFile_Test tsfile)
@@ -312,4 +397,12 @@ else()
message("BUILD_TEST is OFF, skipping test directory")
endif ()
+if (NOT "${_TSFILE_PROJECT_DEPENDENCIES}" STREQUAL "")
+ set_property(DIRECTORY PROPERTY LINK_LIBRARIES
+ "${_TSFILE_PROJECT_LINK_LIBRARIES}")
+ unset(_TSFILE_BASE_LINK_LIBRARIES)
+ unset(_TSFILE_PROJECT_LINK_LIBRARIES)
+endif ()
+unset(_TSFILE_PROJECT_DEPENDENCIES)
+
add_subdirectory(examples)
diff --git a/cpp/README.md b/cpp/README.md
index 5f62afe24..6341287e4 100644
--- a/cpp/README.md
+++ b/cpp/README.md
@@ -156,6 +156,154 @@ cmake -S cpp -B cpp/build/static \
cmake --build cpp/build/static --target tsfile
```
+### Dependency Source Selection
+
+The global `TSFILE_DEPENDENCY_SOURCE` CMake option defines how migrated C++
+dependencies are resolved:
+
+- `AUTO` (default): prefer a compatible system package and fall back to the
+ verified source archive managed by the build.
+- `SYSTEM`: require compatible system packages and fail configuration with a
+ clear error when one is unavailable.
+- `BUNDLED`: download and build pinned dependency source archives managed by
+ the TsFile build.
+
+ANTLR4, Snappy, LZ4, lzokay, SIMDe, zlib, Zstandard, and liblzma are currently
+resolved through this policy. A compatible system ANTLR4 must be version 4.9.3
+or newer and earlier than 5.0.0, and provide an `antlr4_static` or
+`antlr4_shared` target. A compatible system Snappy must be version 1.2.1 or
+newer in the 1.x release series and provide the `Snappy::snappy` CMake target.
+A compatible system LZ4 must be version 1.9.4 or newer in the 1.x release
+series. A compatible system lzokay package must be version 0.1 or newer and
+earlier than 1.0, and provide the `lzokay::lzokay` CMake target. A compatible
+system SIMDe installation must be version 0.8.4 or newer and earlier than
+1.0.0; the build accepts either its `simde::simde` CMake target or installed
+headers. A compatible system zlib must be version 1.3.1 or newer and earlier
+than 2.0.0.
+A compatible system Zstandard must be version 1.5.7 or newer and earlier than
+2.0.0. A compatible system liblzma must be version 5.8.3 or newer and earlier
+than 6.0.0.
+
+The dependency-free legacy core remains buildable with CMake 3.11 for
+long-lived industrial toolchains. The following minimal profile isolates that
+baseline from the separate version and platform requirements of optional
+dependencies:
+
+```bash
+mkdir -p cpp/build/legacy-core
+cd cpp/build/legacy-core
+cmake ../.. \
+ -DBUILD_TEST=OFF \
+ -DBUILD_TOOLS=OFF \
+ -DENABLE_ANTLR4=OFF \
+ -DENABLE_SNAPPY=OFF \
+ -DENABLE_LZ4=OFF \
+ -DENABLE_LZOKAY=OFF \
+ -DENABLE_ZLIB=OFF \
+ -DENABLE_ZSTD=OFF \
+ -DENABLE_SIMD=OFF
+cmake --build . --target tsfile -- -j2
+cd ../../..
+```
+
+Dependency-enabled configurations may have a higher minimum when an upstream
+dependency's build is used. LZMA2 is disabled by default so its bundled
+dependency does not raise the project-wide floor to CMake 3.20. Enable it
+explicitly with `-DENABLE_LZMA2=ON`. With CMake 3.11 through 3.19, select a
+compatible system liblzma package; the verified bundled XZ Utils build requires
+CMake 3.20 or newer:
+
+The `OFF` default applies to new build directories. An existing CMake cache
+keeps its previously configured value; pass `-DENABLE_LZMA2=OFF` explicitly or
+use a fresh build directory when validating the default.
+
+```bash
+# CMake 3.11-3.19: use an externally installed compatible liblzma.
+mkdir -p cpp/build/lzma2-system
+cd cpp/build/lzma2-system
+cmake ../.. \
+ -DENABLE_LZMA2=ON \
+ -DTSFILE_DEPENDENCY_SOURCE=SYSTEM
+cd ../../..
+
+# CMake 3.20+: build the verified XZ Utils source archive.
+cmake -S cpp -B cpp/build/lzma2-bundled \
+ -DENABLE_LZMA2=ON \
+ -DTSFILE_DEPENDENCY_SOURCE=BUNDLED
+```
+
+For Maven, pass `-Denable.lzma2=ON`. For `build.sh`, pass
+`--enable-lzma2=ON`.
+
+For a direct CMake build, select the policy with:
+
+```bash
+cmake -S cpp -B cpp/build/system \
+ -DTSFILE_DEPENDENCY_SOURCE=SYSTEM
+```
+
+If LZ4, SIMDe, or zlib is installed in a non-standard prefix, set `LZ4_ROOT`,
+`SIMDE_ROOT`, or `ZLIB_ROOT`, respectively. For ANTLR4, Snappy, lzokay,
+Zstandard, and liblzma, set `antlr4-runtime_DIR`, `Snappy_DIR`, `lzokay_DIR`,
+`zstd_DIR`, or `liblzma_DIR` to the directory containing the corresponding
+package configuration file:
+
+```bash
+cmake -S cpp -B cpp/build/system \
+ -DTSFILE_DEPENDENCY_SOURCE=SYSTEM \
+ -Dantlr4-runtime_DIR=/path/to/lib/cmake/antlr4-runtime \
+ -DSnappy_DIR=/path/to/lib/cmake/Snappy \
+ -DLZ4_ROOT=/path/to/lz4 \
+ -Dlzokay_DIR=/path/to/lib/cmake/lzokay \
+ -DSIMDE_ROOT=/path/to/simde \
+ -DZLIB_ROOT=/path/to/zlib \
+ -Dzstd_DIR=/path/to/lib/cmake/zstd \
+ -Dliblzma_DIR=/path/to/lib/cmake/liblzma
+```
+
+For a Maven build, use the corresponding Maven property:
+
+```bash
+mvn clean verify -P with-cpp \
+ -Dtsfile.dependency.source=SYSTEM
+```
+
+In `BUNDLED` mode, ANTLR4 4.9.3, its utf8cpp v3.1.1 support library, Snappy
+v1.2.2, LZ4 v1.9.4, lzokay commit `5cb18da`, SIMDe v0.8.4-rc3, zlib v1.3.1,
+and Zstandard v1.5.7 are downloaded from their upstream archives and verified
+with SHA-256 before extraction. When LZMA2 is enabled, XZ Utils v5.8.3 is
+managed in the same way. Third-party source is placed in the build directory
+and is not committed to this repository.
+
+For an offline build with the migrated dependencies enabled, first place
+`antlr4-4.9.3.tar.gz`, `utfcpp-v3.1.1.tar.gz`, `snappy-1.2.2.tar.gz`,
+`lz4-v1.9.4.tar.gz`,
+`lzokay-5cb18da508cc4d3ec41bc04dccdeef9c5ffedfb2.tar.gz`,
+`simde-v0.8.4-rc3.tar.gz`, `zlib-v1.3.1.tar.gz`, and
+`zstd-v1.5.7.tar.gz` in a persistent cache. If LZMA2 is explicitly enabled,
+also provide `xz-5.8.3.tar.gz`. Then configure with network access disabled:
+
+```bash
+cmake -S cpp -B cpp/build/offline \
+ -DTSFILE_DEPENDENCY_SOURCE=BUNDLED \
+ -DTSFILE_DEPENDENCY_OFFLINE=ON \
+ -DTSFILE_DEPENDENCY_CACHE=/path/to/dependency-cache
+```
+
+The archives can also be supplied explicitly with
+`-DTSFILE_ANTLR4_ARCHIVE=/path/to/antlr4-4.9.3.tar.gz`,
+`-DTSFILE_UTF8CPP_ARCHIVE=/path/to/utfcpp-v3.1.1.tar.gz`,
+`-DTSFILE_SNAPPY_ARCHIVE=/path/to/snappy-1.2.2.tar.gz`,
+`-DTSFILE_LZ4_ARCHIVE=/path/to/lz4-v1.9.4.tar.gz`,
+`-DTSFILE_LZOKAY_ARCHIVE=/path/to/lzokay.tar.gz`,
+`-DTSFILE_SIMDE_ARCHIVE=/path/to/simde-v0.8.4-rc3.tar.gz`,
+`-DTSFILE_ZLIB_ARCHIVE=/path/to/zlib-v1.3.1.tar.gz`,
+`-DTSFILE_ZSTD_ARCHIVE=/path/to/zstd-v1.5.7.tar.gz`, and, when LZMA2 is
+enabled, `-DTSFILE_LIBLZMA_ARCHIVE=/path/to/xz-5.8.3.tar.gz`. Cached and
+explicitly supplied archives must match their pinned SHA-256 digests. The
+equivalent Maven properties are `tsfile.dependency.offline` and
+`tsfile.dependency.cache`.
+
Before you submit your code to GitHub, please ensure that the compilation is correct.
### configure the cross-compilation toolchain
diff --git a/cpp/build.sh b/cpp/build.sh
index 3cc100c13..0ca86c4f2 100644
--- a/cpp/build.sh
+++ b/cpp/build.sh
@@ -33,6 +33,10 @@ enable_snappy=ON
enable_lz4=ON
enable_lzokay=ON
enable_zlib=ON
+enable_zstd=ON
+# Keep the default build compatible with CMake 3.11-era industrial toolchains.
+# Bundled XZ Utils requires CMake 3.20+, so LZMA2 must be enabled explicitly.
+enable_lzma2=OFF
shell_dir=$(cd "$(dirname "$0")";pwd)
@@ -66,6 +70,12 @@ Options:
--disable-lzokay
--enable-zlib=<ON|OFF>
--disable-zlib
+ --enable-zstd=<ON|OFF>
+ --disable-zstd
+ --enable-lzma2=<ON|OFF>
+ Enable LZMA2 explicitly (default: OFF; bundled XZ
+ requires CMake 3.20 or newer).
+ --disable-lzma2
-h, --help Show this help message.
EOF
}
@@ -84,6 +94,8 @@ function print_config()
echo "enable_lz4=$enable_lz4"
echo "enable_lzokay=$enable_lzokay"
echo "enable_zlib=$enable_zlib"
+ echo "enable_zstd=$enable_zstd"
+ echo "enable_lzma2=$enable_lzma2"
}
function run_test_for_cov()
@@ -132,6 +144,10 @@ parse_options()
enable_lzokay=$(get_key_value "$1");;
--enable-zlib=*)
enable_zlib=$(get_key_value "$1");;
+ --enable-zstd=*)
+ enable_zstd=$(get_key_value "$1");;
+ --enable-lzma2=*)
+ enable_lzma2=$(get_key_value "$1");;
--disable-antlr4)
enable_antlr4=OFF;;
--disable-snappy)
@@ -142,6 +158,10 @@ parse_options()
enable_lzokay=OFF;;
--disable-zlib)
enable_zlib=OFF;;
+ --disable-zstd)
+ enable_zstd=OFF;;
+ --disable-lzma2)
+ enable_lzma2=OFF;;
-h | --help)
usage
exit 0;;
@@ -209,7 +229,9 @@ cmake ../../ \
-DENABLE_SNAPPY=$enable_snappy \
-DENABLE_LZ4=$enable_lz4 \
-DENABLE_LZOKAY=$enable_lzokay \
- -DENABLE_ZLIB=$enable_zlib
+ -DENABLE_ZLIB=$enable_zlib \
+ -DENABLE_ZSTD=$enable_zstd \
+ -DENABLE_LZMA2=$enable_lzma2
VERBOSE=1 make
if [ ${do_install} -eq 1 ]
diff --git a/cpp/cmake/ANTLR4Dependency.cmake b/cpp/cmake/ANTLR4Dependency.cmake
new file mode 100644
index 000000000..3d772c25c
--- /dev/null
+++ b/cpp/cmake/ANTLR4Dependency.cmake
@@ -0,0 +1,90 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_ANTLR4_MIN_VERSION "4.9.3")
+set(TSFILE_ANTLR4_BUNDLED_VERSION "4.9.3")
+set(TSFILE_ANTLR4_NEXT_INCOMPATIBLE_VERSION "5.0.0")
+set(TSFILE_ANTLR4_SYSTEM_INCLUDE_DIR "")
+set(_TSFILE_SYSTEM_ANTLR4_FOUND FALSE)
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ # ANTLR4 4.9.3 exports its header-only utf8cpp dependency as the bare
+ # target name "utf8cpp". Load that package first so CMake resolves the
+ # name as a target instead of translating it to the nonexistent
+ # -lutf8cpp linker option.
+ find_package(utf8cpp CONFIG QUIET)
+ find_package(antlr4-runtime CONFIG QUIET)
+
+ set(_TSFILE_SYSTEM_ANTLR4_VERSION "${antlr4-runtime_VERSION}")
+ if ("${_TSFILE_SYSTEM_ANTLR4_VERSION}" STREQUAL "" AND
+ DEFINED ANTLR_VERSION)
+ set(_TSFILE_SYSTEM_ANTLR4_VERSION "${ANTLR_VERSION}")
+ endif ()
+
+ set(TSFILE_ANTLR4_SYSTEM_TARGET "")
+ set(TSFILE_ANTLR4_SYSTEM_STATIC FALSE)
+ foreach (_TSFILE_ANTLR4_TARGET
+ antlr4_static
+ antlr4-runtime::antlr4_static
+ antlr4_shared
+ antlr4-runtime::antlr4_shared)
+ if (TARGET ${_TSFILE_ANTLR4_TARGET})
+ set(TSFILE_ANTLR4_SYSTEM_TARGET ${_TSFILE_ANTLR4_TARGET})
+ if (_TSFILE_ANTLR4_TARGET MATCHES "static$")
+ set(TSFILE_ANTLR4_SYSTEM_STATIC TRUE)
+ endif ()
+ break()
+ endif ()
+ endforeach ()
+
+ if (NOT "${TSFILE_ANTLR4_SYSTEM_TARGET}" STREQUAL "" AND
+ NOT "${_TSFILE_SYSTEM_ANTLR4_VERSION}" STREQUAL "" AND
+ NOT _TSFILE_SYSTEM_ANTLR4_VERSION VERSION_LESS
+ TSFILE_ANTLR4_MIN_VERSION AND
+ _TSFILE_SYSTEM_ANTLR4_VERSION VERSION_LESS
+ TSFILE_ANTLR4_NEXT_INCOMPATIBLE_VERSION)
+ set(_TSFILE_SYSTEM_ANTLR4_FOUND TRUE)
+ if (IS_DIRECTORY "${ANTLR4_INCLUDE_DIR}")
+ # ANTLR4 4.9.3's installed targets don't propagate their public
+ # include directory. Keep SYSTEM mode compatible with that
+ # upstream package while newer packages continue to use their
+ # target metadata normally.
+ set(TSFILE_ANTLR4_SYSTEM_INCLUDE_DIR
+ "${ANTLR4_INCLUDE_DIR}")
+ endif ()
+ message(STATUS
+ "Found compatible system ANTLR4 "
+ "${_TSFILE_SYSTEM_ANTLR4_VERSION} target "
+ "${TSFILE_ANTLR4_SYSTEM_TARGET}")
+ elseif (antlr4-runtime_FOUND)
+ message(STATUS
+ "Ignoring incompatible system ANTLR4 "
+ "${_TSFILE_SYSTEM_ANTLR4_VERSION}; TsFile requires "
+ ">=${TSFILE_ANTLR4_MIN_VERSION} and "
+ "<${TSFILE_ANTLR4_NEXT_INCOMPATIBLE_VERSION}, with an "
+ "antlr4_static or antlr4_shared target")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "ANTLR4" "${_TSFILE_SYSTEM_ANTLR4_FOUND}" TSFILE_ANTLR4_SOURCE)
+
+unset(_TSFILE_ANTLR4_TARGET)
+unset(_TSFILE_SYSTEM_ANTLR4_FOUND)
+unset(_TSFILE_SYSTEM_ANTLR4_VERSION)
diff --git a/cpp/cmake/ANTLR4Patch.cmake b/cpp/cmake/ANTLR4Patch.cmake
new file mode 100644
index 000000000..2283fe34e
--- /dev/null
+++ b/cpp/cmake/ANTLR4Patch.cmake
@@ -0,0 +1,146 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TSFILE_ANTLR4_RUNTIME_DIR)
+ message(FATAL_ERROR "TSFILE_ANTLR4_RUNTIME_DIR must be provided.")
+endif ()
+
+function(_tsfile_patch_antlr4_file RELATIVE_PATH OLD_TEXT NEW_TEXT)
+ if (TSFILE_ANTLR4_PATCH_VERIFY_ONLY)
+ return()
+ endif ()
+
+ set(_TSFILE_PATCH_FILE
+ "${TSFILE_ANTLR4_RUNTIME_DIR}/src/${RELATIVE_PATH}")
+ file(READ "${_TSFILE_PATCH_FILE}" _TSFILE_PATCH_CONTENT)
+ string(FIND "${_TSFILE_PATCH_CONTENT}" "${OLD_TEXT}"
+ _TSFILE_PATCH_POSITION)
+ if (_TSFILE_PATCH_POSITION EQUAL -1)
+ message(FATAL_ERROR
+ "Cannot apply the TsFile ANTLR4 compatibility patch to "
+ "${RELATIVE_PATH}: expected source text is missing.")
+ endif ()
+ string(REPLACE "${OLD_TEXT}" "${NEW_TEXT}"
+ _TSFILE_PATCH_CONTENT "${_TSFILE_PATCH_CONTENT}")
+ file(WRITE "${_TSFILE_PATCH_FILE}" "${_TSFILE_PATCH_CONTENT}")
+endfunction()
+
+_tsfile_patch_antlr4_file("RuleContext.h"
+ [[bool operator == (const RuleContext &other) { return this == &other; }]]
+ [[bool equal(const RuleContext &other) { return this == &other; }]])
+_tsfile_patch_antlr4_file("Token.h"
+ [[#if __cplusplus >= 201703L]]
+ [[#if __cplusplus >= 201703L || defined(_MSC_VER)]])
+_tsfile_patch_antlr4_file("Vocabulary.cpp"
+ [[
+#include "Token.h"]]
+ [[
+#include <locale>
+
+#include "Token.h"]])
+_tsfile_patch_antlr4_file("atn/ATN.cpp"
+ [[expected.add(Token::EOF);]]
+ [[expected.add(static_cast<int>(Token::EOF));]])
+_tsfile_patch_antlr4_file("atn/LL1Analyzer.cpp"
+ [[look.add(Token::EPSILON);]]
+ [[look.add(static_cast<int>(Token::EPSILON));]])
+_tsfile_patch_antlr4_file("atn/LL1Analyzer.cpp"
+ [[look.add(Token::EOF);]]
+ [[look.add(static_cast<int>(Token::EOF));]])
+_tsfile_patch_antlr4_file("atn/LL1Analyzer.h"
+ [[#if __cplusplus >= 201703L]]
+ [[#if __cplusplus >= 201703L || defined(_MSC_VER)]])
+_tsfile_patch_antlr4_file("atn/LexerATNSimulator.cpp"
+ [[
+LexerATNSimulator::SimState::~SimState() {
+}
+]]
+ [[]])
+_tsfile_patch_antlr4_file("atn/LexerATNSimulator.h"
+ [[virtual ~SimState();]]
+ [[virtual ~SimState() {(void)0;}]])
+_tsfile_patch_antlr4_file("atn/LexerATNSimulator.h"
+ [[virtual ~LexerATNSimulator () {}]]
+ [[virtual ~LexerATNSimulator () {(void)0;}]])
+_tsfile_patch_antlr4_file("misc/IntervalSet.cpp"
+ [[_intervals = move(other._intervals);]]
+ [[_intervals = std::move(other._intervals);]])
+_tsfile_patch_antlr4_file("support/Any.h"
+ [[template<int N = 0, typename std::enable_if<N == N && std::is_nothrow_copy_constructible<T>::value, int>::type = 0>]]
+ [[template<typename U = T, typename std::enable_if<std::is_nothrow_copy_constructible<U>::value, int>::type = 0>]])
+_tsfile_patch_antlr4_file("support/Any.h"
+ [[template<int N = 0, typename std::enable_if<N == N && !std::is_nothrow_copy_constructible<T>::value, int>::type = 0>]]
+ [[template<typename U = T, typename std::enable_if<!std::is_nothrow_copy_constructible<U>::value, int>::type = 0>]])
+_tsfile_patch_antlr4_file("support/CPPUtils.cpp"
+ [[ if (escapeSpaces) {
+ result += "\u00B7";
+ break;
+ }
+ // else fall through]]
+ [[ if (escapeSpaces) {
+ result += "\u00B7";
+ break;
+ } else {
+ result += c;
+ break;
+ }
+ // else fall through]])
+
+function(_tsfile_verify_antlr4_patch RELATIVE_PATH EXPECTED_SHA256)
+ # CMake writes text files using the host newline convention. Hash the
+ # reviewed patch content after normalizing line endings so the same source
+ # is accepted on Unix and Windows while every other byte remains covered.
+ file(READ "${TSFILE_ANTLR4_RUNTIME_DIR}/src/${RELATIVE_PATH}"
+ _TSFILE_PATCHED_CONTENT)
+ string(REPLACE "\r\n" "\n" _TSFILE_PATCHED_CONTENT
+ "${_TSFILE_PATCHED_CONTENT}")
+ string(REPLACE "\r" "\n" _TSFILE_PATCHED_CONTENT
+ "${_TSFILE_PATCHED_CONTENT}")
+ string(SHA256 _TSFILE_PATCHED_SHA256
+ "${_TSFILE_PATCHED_CONTENT}")
+ if (NOT _TSFILE_PATCHED_SHA256 STREQUAL EXPECTED_SHA256)
+ message(FATAL_ERROR
+ "The patched ANTLR4 file ${RELATIVE_PATH} does not match "
+ "the reviewed TsFile compatibility patch set. Expected "
+ "${EXPECTED_SHA256}, got ${_TSFILE_PATCHED_SHA256}.")
+ endif ()
+endfunction()
+
+_tsfile_verify_antlr4_patch("RuleContext.h"
+ "a2db34e609a614b55bae993a1d7a5eae319ef13e079de0b219f6989bc3cceacd")
+_tsfile_verify_antlr4_patch("Token.h"
+ "5963319fafbc3bd2d35d9726870e6be9e74f1111bfa993a79c97a5d47b85451d")
+_tsfile_verify_antlr4_patch("Vocabulary.cpp"
+ "9b774edfb8bcca7f869d17f1292ec38355bf5e1abc0c3e1fc582f917a74f6056")
+_tsfile_verify_antlr4_patch("atn/ATN.cpp"
+ "4fde921ac9c4e52327cfb7c2856b7786aaf1020b30a436ee61ca45597f07567e")
+_tsfile_verify_antlr4_patch("atn/LL1Analyzer.cpp"
+ "b4a26bba4fa7c8ff89aff9a8c374337523ff22346f275a01edc4fa855f212462")
+_tsfile_verify_antlr4_patch("atn/LL1Analyzer.h"
+ "a209e24d0c0ec304fe82a4fe6130d044ccd033927818c7e9372b76037caa91df")
+_tsfile_verify_antlr4_patch("atn/LexerATNSimulator.cpp"
+ "3b8fd401103ed111de680b9d0a7539d4e9d3654e47f92837aa11982dec5ed417")
+_tsfile_verify_antlr4_patch("atn/LexerATNSimulator.h"
+ "3d6b6f4b2a2ef5840fec226730b45faeaa9413ccf89b810d49dbf6308ea60e06")
+_tsfile_verify_antlr4_patch("misc/IntervalSet.cpp"
+ "8df38b75f0c9f84436c7066d708c2ee7af7a81e4ba6125c57b0d953e376b5cd0")
+_tsfile_verify_antlr4_patch("support/Any.h"
+ "23a2bbe88cea05d7e09263f5da5ba95d3e47f98c864e868a9116419e35f48c7b")
+_tsfile_verify_antlr4_patch("support/CPPUtils.cpp"
+ "4ef80e171fc581eb7276b53fb587a763cbd65621fbc615584d71fc183463c76d")
diff --git a/cpp/cmake/ANTLR4Source.cmake b/cpp/cmake/ANTLR4Source.cmake
new file mode 100644
index 000000000..9094ab09f
--- /dev/null
+++ b/cpp/cmake/ANTLR4Source.cmake
@@ -0,0 +1,211 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_ANTLR4_ARCHIVE_NAME
+ "antlr4-${TSFILE_ANTLR4_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_ANTLR4_URL
+ "https://github.com/antlr/antlr4/archive/refs/tags/${TSFILE_ANTLR4_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_ANTLR4_SHA256
+ "efe4057d75ab48145d4683100fec7f77d7f87fa258707330cadd1f8e6f7eecae")
+set(_TSFILE_UTF8CPP_VERSION "3.1.1")
+set(_TSFILE_UTF8CPP_ARCHIVE_NAME
+ "utfcpp-v${_TSFILE_UTF8CPP_VERSION}.tar.gz")
+set(_TSFILE_UTF8CPP_URL
+ "https://github.com/nemtrif/utfcpp/archive/refs/tags/v${_TSFILE_UTF8CPP_VERSION}.tar.gz")
+set(_TSFILE_UTF8CPP_SHA256
+ "33496a4c3cc2de80e9809c4997052331af5fb32079f43ab4d667cd48c3a36e88")
+
+set(TSFILE_ANTLR4_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded ANTLR4 source archive")
+set(TSFILE_UTF8CPP_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded utf8cpp source archive for ANTLR4")
+
+function(_tsfile_prepare_antlr4_archive
+ DEPENDENCY ARCHIVE_VARIABLE ARCHIVE_NAME URL SHA256 SOURCE_DIR
+ REQUIRED_FILES STAMP_VALUE PATCH_SCRIPT)
+ set(_TSFILE_ARCHIVE "${${ARCHIVE_VARIABLE}}")
+ if (_TSFILE_ARCHIVE)
+ get_filename_component(_TSFILE_ARCHIVE
+ "${_TSFILE_ARCHIVE}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_ARCHIVE}")
+ message(FATAL_ERROR
+ "${ARCHIVE_VARIABLE} does not exist: "
+ "${_TSFILE_ARCHIVE}")
+ endif ()
+ set(_TSFILE_EXPLICIT_ARCHIVE TRUE)
+ else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${ARCHIVE_NAME}")
+ set(_TSFILE_EXPLICIT_ARCHIVE FALSE)
+ endif ()
+
+ set(_TSFILE_ARCHIVE_VALID FALSE)
+ if (EXISTS "${_TSFILE_ARCHIVE}")
+ file(SHA256 "${_TSFILE_ARCHIVE}" _TSFILE_ACTUAL_SHA256)
+ if (_TSFILE_ACTUAL_SHA256 STREQUAL SHA256)
+ set(_TSFILE_ARCHIVE_VALID TRUE)
+ elseif (_TSFILE_EXPLICIT_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "${DEPENDENCY} source archive has an unexpected SHA-256: "
+ "${_TSFILE_ARCHIVE}\n"
+ "Expected: ${SHA256}\n"
+ "Actual: ${_TSFILE_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached ${DEPENDENCY} archive: "
+ "${_TSFILE_ARCHIVE}")
+ file(REMOVE "${_TSFILE_ARCHIVE}")
+ endif ()
+ endif ()
+
+ if (NOT _TSFILE_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified "
+ "${DEPENDENCY} archive at ${_TSFILE_ARCHIVE}. "
+ "Pre-download ${URL} or set ${ARCHIVE_VARIABLE} to a "
+ "verified local archive.")
+ endif ()
+
+ set(_TSFILE_PARTIAL_ARCHIVE "${_TSFILE_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_PARTIAL_ARCHIVE}")
+ message(STATUS "Downloading ${DEPENDENCY}")
+ file(DOWNLOAD
+ "${URL}"
+ "${_TSFILE_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_DOWNLOAD_STATUS 0 _TSFILE_DOWNLOAD_RESULT)
+ list(GET _TSFILE_DOWNLOAD_STATUS 1 _TSFILE_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download ${DEPENDENCY} from ${URL}: "
+ "${_TSFILE_DOWNLOAD_MESSAGE}. To build without network "
+ "access, provide ${ARCHIVE_NAME} in "
+ "TSFILE_DEPENDENCY_CACHE or set ${ARCHIVE_VARIABLE}.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_PARTIAL_ARCHIVE}" _TSFILE_ACTUAL_SHA256)
+ if (NOT _TSFILE_ACTUAL_SHA256 STREQUAL SHA256)
+ file(REMOVE "${_TSFILE_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded ${DEPENDENCY} archive has an unexpected "
+ "SHA-256. Expected ${SHA256}, got "
+ "${_TSFILE_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_PARTIAL_ARCHIVE}" "${_TSFILE_ARCHIVE}")
+ endif ()
+
+ set(_TSFILE_STAMP "${SOURCE_DIR}/.tsfile-source-stamp")
+ set(_TSFILE_EXTRACTED FALSE)
+ set(_TSFILE_REQUIRED_FILES_PRESENT TRUE)
+ foreach (_TSFILE_REQUIRED_FILE ${REQUIRED_FILES})
+ if (NOT EXISTS "${SOURCE_DIR}/${_TSFILE_REQUIRED_FILE}")
+ set(_TSFILE_REQUIRED_FILES_PRESENT FALSE)
+ endif ()
+ endforeach ()
+ if (EXISTS "${_TSFILE_STAMP}" AND _TSFILE_REQUIRED_FILES_PRESENT)
+ file(READ "${_TSFILE_STAMP}" _TSFILE_EXISTING_STAMP)
+ string(STRIP "${_TSFILE_EXISTING_STAMP}" _TSFILE_EXISTING_STAMP)
+ if (_TSFILE_EXISTING_STAMP STREQUAL STAMP_VALUE)
+ set(_TSFILE_EXTRACTED TRUE)
+ endif ()
+ endif ()
+
+ if (NOT _TSFILE_EXTRACTED)
+ file(REMOVE_RECURSE "${SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/_deps")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf "${_TSFILE_ARCHIVE}"
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/_deps"
+ RESULT_VARIABLE _TSFILE_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_EXTRACT_ERROR)
+ set(_TSFILE_REQUIRED_FILES_PRESENT TRUE)
+ foreach (_TSFILE_REQUIRED_FILE ${REQUIRED_FILES})
+ if (NOT EXISTS "${SOURCE_DIR}/${_TSFILE_REQUIRED_FILE}")
+ set(_TSFILE_REQUIRED_FILES_PRESENT FALSE)
+ endif ()
+ endforeach ()
+ if (NOT _TSFILE_EXTRACT_RESULT EQUAL 0 OR
+ NOT _TSFILE_REQUIRED_FILES_PRESENT)
+ file(REMOVE_RECURSE "${SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the ${DEPENDENCY} source archive: "
+ "${_TSFILE_EXTRACT_ERROR}")
+ endif ()
+ if (PATCH_SCRIPT)
+ set(TSFILE_ANTLR4_RUNTIME_DIR "${SOURCE_DIR}/runtime/Cpp/runtime")
+ include("${PATCH_SCRIPT}")
+ unset(TSFILE_ANTLR4_RUNTIME_DIR)
+ endif ()
+ file(WRITE "${_TSFILE_STAMP}" "${STAMP_VALUE}\n")
+ endif ()
+
+ set(${ARCHIVE_VARIABLE}_RESOLVED "${_TSFILE_ARCHIVE}" PARENT_SCOPE)
+endfunction()
+
+set(TSFILE_ANTLR4_SOURCE_DIR
+ "${CMAKE_BINARY_DIR}/_deps/antlr4-${TSFILE_ANTLR4_BUNDLED_VERSION}")
+set(TSFILE_UTF8CPP_SOURCE_DIR
+ "${CMAKE_BINARY_DIR}/_deps/utfcpp-${_TSFILE_UTF8CPP_VERSION}")
+
+_tsfile_prepare_antlr4_archive(
+ "ANTLR4 ${TSFILE_ANTLR4_BUNDLED_VERSION}"
+ TSFILE_ANTLR4_ARCHIVE
+ "${_TSFILE_ANTLR4_ARCHIVE_NAME}"
+ "${_TSFILE_ANTLR4_URL}"
+ "${_TSFILE_ANTLR4_SHA256}"
+ "${TSFILE_ANTLR4_SOURCE_DIR}"
+ "LICENSE.txt;runtime/Cpp/runtime/src/antlr4-runtime.h;runtime/Cpp/runtime/src/support/StringUtils.cpp"
+ "${_TSFILE_ANTLR4_SHA256}:tsfile-compat-1"
+ "${CMAKE_CURRENT_LIST_DIR}/ANTLR4Patch.cmake")
+
+_tsfile_prepare_antlr4_archive(
+ "utf8cpp v${_TSFILE_UTF8CPP_VERSION}"
+ TSFILE_UTF8CPP_ARCHIVE
+ "${_TSFILE_UTF8CPP_ARCHIVE_NAME}"
+ "${_TSFILE_UTF8CPP_URL}"
+ "${_TSFILE_UTF8CPP_SHA256}"
+ "${TSFILE_UTF8CPP_SOURCE_DIR}"
+ "LICENSE;source/utf8.h;source/utf8/core.h"
+ "${_TSFILE_UTF8CPP_SHA256}"
+ "")
+
+set(TSFILE_ANTLR4_LICENSE_FILE "${TSFILE_ANTLR4_SOURCE_DIR}/LICENSE.txt")
+set(TSFILE_UTF8CPP_LICENSE_FILE "${TSFILE_UTF8CPP_SOURCE_DIR}/LICENSE")
+message(STATUS
+ "Using verified ANTLR4 ${TSFILE_ANTLR4_BUNDLED_VERSION} source from "
+ "${TSFILE_ANTLR4_ARCHIVE_RESOLVED}")
+message(STATUS
+ "Using verified utf8cpp v${_TSFILE_UTF8CPP_VERSION} source from "
+ "${TSFILE_UTF8CPP_ARCHIVE_RESOLVED}")
+
+unset(_TSFILE_ANTLR4_ARCHIVE_NAME)
+unset(_TSFILE_ANTLR4_SHA256)
+unset(_TSFILE_ANTLR4_URL)
+unset(_TSFILE_UTF8CPP_ARCHIVE_NAME)
+unset(_TSFILE_UTF8CPP_SHA256)
+unset(_TSFILE_UTF8CPP_URL)
+unset(_TSFILE_UTF8CPP_VERSION)
diff --git a/cpp/cmake/CopyToDir.cmake b/cpp/cmake/CopyToDir.cmake
index c57e11ffc..476e135b8 100644
--- a/cpp/cmake/CopyToDir.cmake
+++ b/cpp/cmake/CopyToDir.cmake
@@ -23,7 +23,11 @@ under the License.
function(copy_to_dir)
set(INCLUDE_EXPORT_DR ${LIBRARY_INCLUDE_DIR} CACHE INTERNAL "Include export directory")
math(EXPR file_path_length "${ARGC} - 1")
- list(SUBLIST ARGN 0 ${file_path_length} file_paths)
+ # list(SUBLIST) was added in CMake 3.12. Keep this helper compatible with
+ # TsFile's CMake 3.11 baseline by copying the argument list and removing
+ # its final element, which is the parent target name.
+ set(file_paths ${ARGN})
+ list(REMOVE_AT file_paths ${file_path_length})
list(GET ARGN ${file_path_length} parent)
add_custom_command(
@@ -48,4 +52,3 @@ function(copy_to_dir)
add_dependencies(${parent} copy_${parent})
endfunction()
-
diff --git a/cpp/cmake/DependencySource.cmake b/cpp/cmake/DependencySource.cmake
new file mode 100644
index 000000000..5f4bc25a6
--- /dev/null
+++ b/cpp/cmake/DependencySource.cmake
@@ -0,0 +1,91 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+include_guard(GLOBAL)
+
+set(TSFILE_DEPENDENCY_CACHE "${CMAKE_BINARY_DIR}/dependency-cache"
+ CACHE PATH
+ "Directory containing downloaded third-party source archives")
+set(TSFILE_DEPENDENCY_OFFLINE OFF
+ CACHE BOOL
+ "Disallow network downloads and require cached dependency archives")
+
+set(TSFILE_DEPENDENCY_SOURCE "AUTO"
+ CACHE STRING
+ "Dependency source policy: AUTO, SYSTEM, or BUNDLED")
+set_property(CACHE TSFILE_DEPENDENCY_SOURCE
+ PROPERTY STRINGS AUTO SYSTEM BUNDLED)
+
+string(TOUPPER "${TSFILE_DEPENDENCY_SOURCE}"
+ _TSFILE_NORMALIZED_DEPENDENCY_SOURCE)
+set(TSFILE_DEPENDENCY_SOURCE
+ "${_TSFILE_NORMALIZED_DEPENDENCY_SOURCE}"
+ CACHE STRING
+ "Dependency source policy: AUTO, SYSTEM, or BUNDLED"
+ FORCE)
+unset(_TSFILE_NORMALIZED_DEPENDENCY_SOURCE)
+
+set(_TSFILE_SUPPORTED_DEPENDENCY_SOURCES AUTO SYSTEM BUNDLED)
+list(FIND _TSFILE_SUPPORTED_DEPENDENCY_SOURCES
+ "${TSFILE_DEPENDENCY_SOURCE}"
+ _TSFILE_DEPENDENCY_SOURCE_INDEX)
+if (_TSFILE_DEPENDENCY_SOURCE_INDEX EQUAL -1)
+ message(FATAL_ERROR
+ "Invalid TSFILE_DEPENDENCY_SOURCE='${TSFILE_DEPENDENCY_SOURCE}'. "
+ "Expected one of: AUTO, SYSTEM, BUNDLED.")
+endif ()
+unset(_TSFILE_DEPENDENCY_SOURCE_INDEX)
+unset(_TSFILE_SUPPORTED_DEPENDENCY_SOURCES)
+
+message(STATUS
+ "TsFile dependency source policy: ${TSFILE_DEPENDENCY_SOURCE}")
+
+# Resolve the source for one dependency after its migration has probed for a
+# compatible system package. SYSTEM_FOUND must be a boolean value, not the name
+# of a CMake variable. The selected source is returned as SYSTEM or BUNDLED.
+function(tsfile_resolve_dependency_source DEPENDENCY SYSTEM_FOUND OUTPUT_VARIABLE)
+ if (NOT ARGC EQUAL 3)
+ message(FATAL_ERROR
+ "tsfile_resolve_dependency_source expects: "
+ "DEPENDENCY SYSTEM_FOUND OUTPUT_VARIABLE")
+ endif ()
+ if ("${DEPENDENCY}" STREQUAL "")
+ message(FATAL_ERROR "Dependency name must not be empty.")
+ endif ()
+ if ("${OUTPUT_VARIABLE}" STREQUAL "")
+ message(FATAL_ERROR
+ "Output variable must not be empty for dependency ${DEPENDENCY}.")
+ endif ()
+
+ if (TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ set(_TSFILE_SELECTED_SOURCE BUNDLED)
+ elseif (SYSTEM_FOUND)
+ set(_TSFILE_SELECTED_SOURCE SYSTEM)
+ elseif (TSFILE_DEPENDENCY_SOURCE STREQUAL "SYSTEM")
+ message(FATAL_ERROR
+ "TSFILE_DEPENDENCY_SOURCE=SYSTEM requires a compatible "
+ "system ${DEPENDENCY} package, but none was found.")
+ else ()
+ set(_TSFILE_SELECTED_SOURCE BUNDLED)
+ endif ()
+
+ message(STATUS
+ "TsFile dependency ${DEPENDENCY}: ${_TSFILE_SELECTED_SOURCE}")
+ set(${OUTPUT_VARIABLE} "${_TSFILE_SELECTED_SOURCE}" PARENT_SCOPE)
+endfunction()
diff --git a/cpp/cmake/FindLZ4.cmake b/cpp/cmake/FindLZ4.cmake
new file mode 100644
index 000000000..a2ceba098
--- /dev/null
+++ b/cpp/cmake/FindLZ4.cmake
@@ -0,0 +1,72 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+find_path(LZ4_INCLUDE_DIR
+ NAMES lz4.h
+ HINTS "${LZ4_ROOT}" ENV LZ4_ROOT
+ PATH_SUFFIXES include)
+
+find_library(LZ4_LIBRARY
+ NAMES lz4 liblz4
+ HINTS "${LZ4_ROOT}" ENV LZ4_ROOT
+ PATH_SUFFIXES lib lib64)
+
+if (LZ4_INCLUDE_DIR AND EXISTS "${LZ4_INCLUDE_DIR}/lz4.h")
+ file(READ "${LZ4_INCLUDE_DIR}/lz4.h" _LZ4_HEADER_CONTENTS)
+ foreach (_LZ4_VERSION_COMPONENT MAJOR MINOR RELEASE)
+ string(REGEX MATCH
+ "#[ \t]*define[ \t]+LZ4_VERSION_${_LZ4_VERSION_COMPONENT}[ \t\\\\\r\n]+([0-9]+)"
+ _LZ4_VERSION_MATCH
+ "${_LZ4_HEADER_CONTENTS}")
+ set(_LZ4_VERSION_${_LZ4_VERSION_COMPONENT} "${CMAKE_MATCH_1}")
+ endforeach ()
+
+ if (_LZ4_VERSION_MAJOR AND
+ NOT "${_LZ4_VERSION_MINOR}" STREQUAL "" AND
+ NOT "${_LZ4_VERSION_RELEASE}" STREQUAL "")
+ set(LZ4_VERSION
+ "${_LZ4_VERSION_MAJOR}.${_LZ4_VERSION_MINOR}.${_LZ4_VERSION_RELEASE}")
+ endif ()
+endif ()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LZ4
+ REQUIRED_VARS LZ4_LIBRARY LZ4_INCLUDE_DIR LZ4_VERSION
+ VERSION_VAR LZ4_VERSION)
+
+if (LZ4_FOUND)
+ set(LZ4_INCLUDE_DIRS "${LZ4_INCLUDE_DIR}")
+ set(LZ4_LIBRARIES "${LZ4_LIBRARY}")
+
+ if (NOT TARGET LZ4::LZ4)
+ add_library(LZ4::LZ4 UNKNOWN IMPORTED)
+ set_target_properties(LZ4::LZ4 PROPERTIES
+ IMPORTED_LOCATION "${LZ4_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}")
+ endif ()
+endif ()
+
+mark_as_advanced(LZ4_INCLUDE_DIR LZ4_LIBRARY)
+
+unset(_LZ4_HEADER_CONTENTS)
+unset(_LZ4_VERSION_MAJOR)
+unset(_LZ4_VERSION_MINOR)
+unset(_LZ4_VERSION_RELEASE)
+unset(_LZ4_VERSION_COMPONENT)
+unset(_LZ4_VERSION_MATCH)
diff --git a/cpp/cmake/LZ4Dependency.cmake b/cpp/cmake/LZ4Dependency.cmake
new file mode 100644
index 000000000..216fa765f
--- /dev/null
+++ b/cpp/cmake/LZ4Dependency.cmake
@@ -0,0 +1,41 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_LZ4_MIN_VERSION "1.9.4")
+set(TSFILE_LZ4_NEXT_INCOMPATIBLE_VERSION "2.0.0")
+set(_TSFILE_SYSTEM_LZ4_FOUND FALSE)
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ find_package(LZ4 ${TSFILE_LZ4_MIN_VERSION} QUIET)
+ if (LZ4_FOUND AND
+ LZ4_VERSION VERSION_LESS TSFILE_LZ4_NEXT_INCOMPATIBLE_VERSION)
+ set(_TSFILE_SYSTEM_LZ4_FOUND TRUE)
+ message(STATUS "Found compatible system LZ4 ${LZ4_VERSION}")
+ elseif (LZ4_FOUND)
+ message(STATUS
+ "Ignoring incompatible system LZ4 ${LZ4_VERSION}; "
+ "TsFile requires >=${TSFILE_LZ4_MIN_VERSION} and "
+ "<${TSFILE_LZ4_NEXT_INCOMPATIBLE_VERSION}")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "LZ4" "${_TSFILE_SYSTEM_LZ4_FOUND}" TSFILE_LZ4_SOURCE)
+
+unset(_TSFILE_SYSTEM_LZ4_FOUND)
diff --git a/cpp/cmake/LZ4Source.cmake b/cpp/cmake/LZ4Source.cmake
new file mode 100644
index 000000000..116ed0ab3
--- /dev/null
+++ b/cpp/cmake/LZ4Source.cmake
@@ -0,0 +1,159 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_LZ4_ARCHIVE_NAME "lz4-v${TSFILE_LZ4_MIN_VERSION}.tar.gz")
+set(_TSFILE_LZ4_URL
+ "https://github.com/lz4/lz4/archive/refs/tags/v${TSFILE_LZ4_MIN_VERSION}.tar.gz")
+set(_TSFILE_LZ4_SHA256
+ "0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b")
+set(TSFILE_LZ4_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded LZ4 v${TSFILE_LZ4_MIN_VERSION} source archive")
+
+if (TSFILE_LZ4_ARCHIVE)
+ get_filename_component(_TSFILE_LZ4_ARCHIVE
+ "${TSFILE_LZ4_ARCHIVE}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_LZ4_ARCHIVE}")
+ message(FATAL_ERROR
+ "TSFILE_LZ4_ARCHIVE does not exist: ${_TSFILE_LZ4_ARCHIVE}")
+ endif ()
+else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_LZ4_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${_TSFILE_LZ4_ARCHIVE_NAME}")
+endif ()
+
+set(_TSFILE_LZ4_ARCHIVE_VALID FALSE)
+if (EXISTS "${_TSFILE_LZ4_ARCHIVE}")
+ file(SHA256 "${_TSFILE_LZ4_ARCHIVE}" _TSFILE_LZ4_ACTUAL_SHA256)
+ if (_TSFILE_LZ4_ACTUAL_SHA256 STREQUAL _TSFILE_LZ4_SHA256)
+ set(_TSFILE_LZ4_ARCHIVE_VALID TRUE)
+ elseif (TSFILE_LZ4_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "LZ4 source archive has an unexpected SHA-256: "
+ "${_TSFILE_LZ4_ARCHIVE}\n"
+ "Expected: ${_TSFILE_LZ4_SHA256}\n"
+ "Actual: ${_TSFILE_LZ4_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached LZ4 archive: ${_TSFILE_LZ4_ARCHIVE}")
+ file(REMOVE "${_TSFILE_LZ4_ARCHIVE}")
+ endif ()
+endif ()
+
+if (NOT _TSFILE_LZ4_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified LZ4 archive at "
+ "${_TSFILE_LZ4_ARCHIVE}. Pre-download ${_TSFILE_LZ4_URL} "
+ "or set TSFILE_LZ4_ARCHIVE to a verified local archive.")
+ endif ()
+
+ set(_TSFILE_LZ4_PARTIAL_ARCHIVE "${_TSFILE_LZ4_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_LZ4_PARTIAL_ARCHIVE}")
+ message(STATUS "Downloading LZ4 v${TSFILE_LZ4_MIN_VERSION}")
+ file(DOWNLOAD
+ "${_TSFILE_LZ4_URL}"
+ "${_TSFILE_LZ4_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_LZ4_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_LZ4_DOWNLOAD_STATUS 0 _TSFILE_LZ4_DOWNLOAD_RESULT)
+ list(GET _TSFILE_LZ4_DOWNLOAD_STATUS 1 _TSFILE_LZ4_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_LZ4_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_LZ4_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download LZ4 from ${_TSFILE_LZ4_URL}: "
+ "${_TSFILE_LZ4_DOWNLOAD_MESSAGE}. To build without network "
+ "access, provide ${_TSFILE_LZ4_ARCHIVE_NAME} in "
+ "TSFILE_DEPENDENCY_CACHE or set TSFILE_LZ4_ARCHIVE.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_LZ4_PARTIAL_ARCHIVE}"
+ _TSFILE_LZ4_ACTUAL_SHA256)
+ if (NOT _TSFILE_LZ4_ACTUAL_SHA256 STREQUAL _TSFILE_LZ4_SHA256)
+ file(REMOVE "${_TSFILE_LZ4_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded LZ4 archive has an unexpected SHA-256. "
+ "Expected ${_TSFILE_LZ4_SHA256}, got "
+ "${_TSFILE_LZ4_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_LZ4_PARTIAL_ARCHIVE}"
+ "${_TSFILE_LZ4_ARCHIVE}")
+endif ()
+
+set(_TSFILE_LZ4_EXTRACT_ROOT "${CMAKE_BINARY_DIR}/_deps")
+set(TSFILE_LZ4_SOURCE_DIR
+ "${_TSFILE_LZ4_EXTRACT_ROOT}/lz4-${TSFILE_LZ4_MIN_VERSION}")
+set(_TSFILE_LZ4_STAMP "${TSFILE_LZ4_SOURCE_DIR}/.tsfile-archive-sha256")
+set(_TSFILE_LZ4_EXTRACTED FALSE)
+if (EXISTS "${_TSFILE_LZ4_STAMP}" AND
+ EXISTS "${TSFILE_LZ4_SOURCE_DIR}/lib/lz4.c" AND
+ EXISTS "${TSFILE_LZ4_SOURCE_DIR}/lib/lz4.h" AND
+ EXISTS "${TSFILE_LZ4_SOURCE_DIR}/lib/LICENSE")
+ file(READ "${_TSFILE_LZ4_STAMP}" _TSFILE_LZ4_STAMP_SHA256)
+ string(STRIP "${_TSFILE_LZ4_STAMP_SHA256}"
+ _TSFILE_LZ4_STAMP_SHA256)
+ if (_TSFILE_LZ4_STAMP_SHA256 STREQUAL _TSFILE_LZ4_SHA256)
+ set(_TSFILE_LZ4_EXTRACTED TRUE)
+ endif ()
+endif ()
+
+if (NOT _TSFILE_LZ4_EXTRACTED)
+ file(REMOVE_RECURSE "${TSFILE_LZ4_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_LZ4_EXTRACT_ROOT}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf "${_TSFILE_LZ4_ARCHIVE}"
+ WORKING_DIRECTORY "${_TSFILE_LZ4_EXTRACT_ROOT}"
+ RESULT_VARIABLE _TSFILE_LZ4_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_LZ4_EXTRACT_ERROR)
+ if (NOT _TSFILE_LZ4_EXTRACT_RESULT EQUAL 0 OR
+ NOT EXISTS "${TSFILE_LZ4_SOURCE_DIR}/lib/lz4.c" OR
+ NOT EXISTS "${TSFILE_LZ4_SOURCE_DIR}/lib/lz4.h" OR
+ NOT EXISTS "${TSFILE_LZ4_SOURCE_DIR}/lib/LICENSE")
+ file(REMOVE_RECURSE "${TSFILE_LZ4_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the LZ4 source archive: "
+ "${_TSFILE_LZ4_EXTRACT_ERROR}")
+ endif ()
+ file(WRITE "${_TSFILE_LZ4_STAMP}" "${_TSFILE_LZ4_SHA256}\n")
+endif ()
+
+set(TSFILE_LZ4_LICENSE_FILE "${TSFILE_LZ4_SOURCE_DIR}/lib/LICENSE")
+message(STATUS
+ "Using verified LZ4 v${TSFILE_LZ4_MIN_VERSION} source from "
+ "${_TSFILE_LZ4_ARCHIVE}")
+
+unset(_TSFILE_LZ4_ACTUAL_SHA256)
+unset(_TSFILE_LZ4_ARCHIVE)
+unset(_TSFILE_LZ4_ARCHIVE_NAME)
+unset(_TSFILE_LZ4_ARCHIVE_VALID)
+unset(_TSFILE_LZ4_DOWNLOAD_MESSAGE)
+unset(_TSFILE_LZ4_DOWNLOAD_RESULT)
+unset(_TSFILE_LZ4_DOWNLOAD_STATUS)
+unset(_TSFILE_LZ4_EXTRACT_ERROR)
+unset(_TSFILE_LZ4_EXTRACT_RESULT)
+unset(_TSFILE_LZ4_EXTRACT_ROOT)
+unset(_TSFILE_LZ4_EXTRACTED)
+unset(_TSFILE_LZ4_PARTIAL_ARCHIVE)
+unset(_TSFILE_LZ4_SHA256)
+unset(_TSFILE_LZ4_STAMP)
+unset(_TSFILE_LZ4_STAMP_SHA256)
+unset(_TSFILE_LZ4_URL)
diff --git a/cpp/cmake/LZOKAYDependency.cmake b/cpp/cmake/LZOKAYDependency.cmake
new file mode 100644
index 000000000..046434e14
--- /dev/null
+++ b/cpp/cmake/LZOKAYDependency.cmake
@@ -0,0 +1,45 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_LZOKAY_MIN_VERSION "0.1")
+set(TSFILE_LZOKAY_NEXT_INCOMPATIBLE_VERSION "1.0")
+set(TSFILE_LZOKAY_COMMIT
+ "5cb18da508cc4d3ec41bc04dccdeef9c5ffedfb2")
+set(_TSFILE_SYSTEM_LZOKAY_FOUND FALSE)
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ find_package(lzokay ${TSFILE_LZOKAY_MIN_VERSION} CONFIG QUIET)
+ if (lzokay_FOUND AND TARGET lzokay::lzokay AND
+ NOT "${lzokay_VERSION}" STREQUAL "" AND
+ lzokay_VERSION VERSION_LESS
+ TSFILE_LZOKAY_NEXT_INCOMPATIBLE_VERSION)
+ set(_TSFILE_SYSTEM_LZOKAY_FOUND TRUE)
+ message(STATUS "Found compatible system lzokay ${lzokay_VERSION}")
+ elseif (lzokay_FOUND)
+ message(STATUS
+ "Ignoring incompatible system lzokay ${lzokay_VERSION}; "
+ "TsFile requires >=${TSFILE_LZOKAY_MIN_VERSION} and "
+ "<${TSFILE_LZOKAY_NEXT_INCOMPATIBLE_VERSION}")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "lzokay" "${_TSFILE_SYSTEM_LZOKAY_FOUND}" TSFILE_LZOKAY_SOURCE)
+
+unset(_TSFILE_SYSTEM_LZOKAY_FOUND)
diff --git a/cpp/cmake/LZOKAYSource.cmake b/cpp/cmake/LZOKAYSource.cmake
new file mode 100644
index 000000000..f6a026000
--- /dev/null
+++ b/cpp/cmake/LZOKAYSource.cmake
@@ -0,0 +1,169 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_LZOKAY_ARCHIVE_NAME
+ "lzokay-${TSFILE_LZOKAY_COMMIT}.tar.gz")
+set(_TSFILE_LZOKAY_URL
+ "https://github.com/AxioDL/lzokay/archive/${TSFILE_LZOKAY_COMMIT}.tar.gz")
+set(_TSFILE_LZOKAY_SHA256
+ "eb518bf793da0b4420a3ffdf1511851575bc62ef350b303f14ff7355f370da6a")
+set(TSFILE_LZOKAY_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded lzokay source archive")
+
+if (TSFILE_LZOKAY_ARCHIVE)
+ get_filename_component(_TSFILE_LZOKAY_ARCHIVE
+ "${TSFILE_LZOKAY_ARCHIVE}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_LZOKAY_ARCHIVE}")
+ message(FATAL_ERROR
+ "TSFILE_LZOKAY_ARCHIVE does not exist: "
+ "${_TSFILE_LZOKAY_ARCHIVE}")
+ endif ()
+else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_LZOKAY_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${_TSFILE_LZOKAY_ARCHIVE_NAME}")
+endif ()
+
+set(_TSFILE_LZOKAY_ARCHIVE_VALID FALSE)
+if (EXISTS "${_TSFILE_LZOKAY_ARCHIVE}")
+ file(SHA256 "${_TSFILE_LZOKAY_ARCHIVE}"
+ _TSFILE_LZOKAY_ACTUAL_SHA256)
+ if (_TSFILE_LZOKAY_ACTUAL_SHA256 STREQUAL _TSFILE_LZOKAY_SHA256)
+ set(_TSFILE_LZOKAY_ARCHIVE_VALID TRUE)
+ elseif (TSFILE_LZOKAY_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "lzokay source archive has an unexpected SHA-256: "
+ "${_TSFILE_LZOKAY_ARCHIVE}\n"
+ "Expected: ${_TSFILE_LZOKAY_SHA256}\n"
+ "Actual: ${_TSFILE_LZOKAY_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached lzokay archive: "
+ "${_TSFILE_LZOKAY_ARCHIVE}")
+ file(REMOVE "${_TSFILE_LZOKAY_ARCHIVE}")
+ endif ()
+endif ()
+
+if (NOT _TSFILE_LZOKAY_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified lzokay archive "
+ "at ${_TSFILE_LZOKAY_ARCHIVE}. Pre-download "
+ "${_TSFILE_LZOKAY_URL} or set TSFILE_LZOKAY_ARCHIVE to a "
+ "verified local archive.")
+ endif ()
+
+ set(_TSFILE_LZOKAY_PARTIAL_ARCHIVE
+ "${_TSFILE_LZOKAY_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_LZOKAY_PARTIAL_ARCHIVE}")
+ message(STATUS "Downloading lzokay ${TSFILE_LZOKAY_COMMIT}")
+ file(DOWNLOAD
+ "${_TSFILE_LZOKAY_URL}"
+ "${_TSFILE_LZOKAY_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_LZOKAY_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_LZOKAY_DOWNLOAD_STATUS 0
+ _TSFILE_LZOKAY_DOWNLOAD_RESULT)
+ list(GET _TSFILE_LZOKAY_DOWNLOAD_STATUS 1
+ _TSFILE_LZOKAY_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_LZOKAY_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_LZOKAY_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download lzokay from ${_TSFILE_LZOKAY_URL}: "
+ "${_TSFILE_LZOKAY_DOWNLOAD_MESSAGE}. To build without "
+ "network access, provide ${_TSFILE_LZOKAY_ARCHIVE_NAME} in "
+ "TSFILE_DEPENDENCY_CACHE or set TSFILE_LZOKAY_ARCHIVE.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_LZOKAY_PARTIAL_ARCHIVE}"
+ _TSFILE_LZOKAY_ACTUAL_SHA256)
+ if (NOT _TSFILE_LZOKAY_ACTUAL_SHA256 STREQUAL _TSFILE_LZOKAY_SHA256)
+ file(REMOVE "${_TSFILE_LZOKAY_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded lzokay archive has an unexpected SHA-256. "
+ "Expected ${_TSFILE_LZOKAY_SHA256}, got "
+ "${_TSFILE_LZOKAY_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_LZOKAY_PARTIAL_ARCHIVE}"
+ "${_TSFILE_LZOKAY_ARCHIVE}")
+endif ()
+
+set(_TSFILE_LZOKAY_EXTRACT_ROOT "${CMAKE_BINARY_DIR}/_deps")
+set(TSFILE_LZOKAY_SOURCE_DIR
+ "${_TSFILE_LZOKAY_EXTRACT_ROOT}/lzokay-${TSFILE_LZOKAY_COMMIT}")
+set(_TSFILE_LZOKAY_STAMP
+ "${TSFILE_LZOKAY_SOURCE_DIR}/.tsfile-archive-sha256")
+set(_TSFILE_LZOKAY_EXTRACTED FALSE)
+if (EXISTS "${_TSFILE_LZOKAY_STAMP}" AND
+ EXISTS "${TSFILE_LZOKAY_SOURCE_DIR}/lzokay.cpp" AND
+ EXISTS "${TSFILE_LZOKAY_SOURCE_DIR}/lzokay.hpp" AND
+ EXISTS "${TSFILE_LZOKAY_SOURCE_DIR}/LICENSE")
+ file(READ "${_TSFILE_LZOKAY_STAMP}" _TSFILE_LZOKAY_STAMP_SHA256)
+ string(STRIP "${_TSFILE_LZOKAY_STAMP_SHA256}"
+ _TSFILE_LZOKAY_STAMP_SHA256)
+ if (_TSFILE_LZOKAY_STAMP_SHA256 STREQUAL _TSFILE_LZOKAY_SHA256)
+ set(_TSFILE_LZOKAY_EXTRACTED TRUE)
+ endif ()
+endif ()
+
+if (NOT _TSFILE_LZOKAY_EXTRACTED)
+ file(REMOVE_RECURSE "${TSFILE_LZOKAY_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_LZOKAY_EXTRACT_ROOT}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf
+ "${_TSFILE_LZOKAY_ARCHIVE}"
+ WORKING_DIRECTORY "${_TSFILE_LZOKAY_EXTRACT_ROOT}"
+ RESULT_VARIABLE _TSFILE_LZOKAY_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_LZOKAY_EXTRACT_ERROR)
+ if (NOT _TSFILE_LZOKAY_EXTRACT_RESULT EQUAL 0 OR
+ NOT EXISTS "${TSFILE_LZOKAY_SOURCE_DIR}/lzokay.cpp" OR
+ NOT EXISTS "${TSFILE_LZOKAY_SOURCE_DIR}/lzokay.hpp" OR
+ NOT EXISTS "${TSFILE_LZOKAY_SOURCE_DIR}/LICENSE")
+ file(REMOVE_RECURSE "${TSFILE_LZOKAY_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the lzokay source archive: "
+ "${_TSFILE_LZOKAY_EXTRACT_ERROR}")
+ endif ()
+ file(WRITE "${_TSFILE_LZOKAY_STAMP}" "${_TSFILE_LZOKAY_SHA256}\n")
+endif ()
+
+set(TSFILE_LZOKAY_LICENSE_FILE "${TSFILE_LZOKAY_SOURCE_DIR}/LICENSE")
+message(STATUS
+ "Using verified lzokay source at ${TSFILE_LZOKAY_COMMIT} from "
+ "${_TSFILE_LZOKAY_ARCHIVE}")
+
+unset(_TSFILE_LZOKAY_ACTUAL_SHA256)
+unset(_TSFILE_LZOKAY_ARCHIVE)
+unset(_TSFILE_LZOKAY_ARCHIVE_NAME)
+unset(_TSFILE_LZOKAY_ARCHIVE_VALID)
+unset(_TSFILE_LZOKAY_DOWNLOAD_MESSAGE)
+unset(_TSFILE_LZOKAY_DOWNLOAD_RESULT)
+unset(_TSFILE_LZOKAY_DOWNLOAD_STATUS)
+unset(_TSFILE_LZOKAY_EXTRACT_ERROR)
+unset(_TSFILE_LZOKAY_EXTRACT_RESULT)
+unset(_TSFILE_LZOKAY_EXTRACT_ROOT)
+unset(_TSFILE_LZOKAY_EXTRACTED)
+unset(_TSFILE_LZOKAY_PARTIAL_ARCHIVE)
+unset(_TSFILE_LZOKAY_SHA256)
+unset(_TSFILE_LZOKAY_STAMP)
+unset(_TSFILE_LZOKAY_STAMP_SHA256)
+unset(_TSFILE_LZOKAY_URL)
diff --git a/cpp/cmake/LibLZMADependency.cmake b/cpp/cmake/LibLZMADependency.cmake
new file mode 100644
index 000000000..1388f89c0
--- /dev/null
+++ b/cpp/cmake/LibLZMADependency.cmake
@@ -0,0 +1,89 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_LIBLZMA_MIN_VERSION "5.8.3")
+set(TSFILE_LIBLZMA_BUNDLED_VERSION "5.8.3")
+set(TSFILE_LIBLZMA_NEXT_INCOMPATIBLE_VERSION "6.0.0")
+set(TSFILE_LIBLZMA_SYSTEM_TARGET "")
+set(_TSFILE_SYSTEM_LIBLZMA_FOUND FALSE)
+set(_TSFILE_SYSTEM_LIBLZMA_VERSION "")
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ # Prefer the package configuration installed by current XZ releases.
+ find_package(liblzma ${TSFILE_LIBLZMA_MIN_VERSION} CONFIG QUIET)
+ if (liblzma_FOUND)
+ set(_TSFILE_SYSTEM_LIBLZMA_VERSION "${liblzma_VERSION}")
+ if (TARGET LibLZMA::LibLZMA)
+ set(TSFILE_LIBLZMA_SYSTEM_TARGET LibLZMA::LibLZMA)
+ elseif (TARGET liblzma::liblzma)
+ set(TSFILE_LIBLZMA_SYSTEM_TARGET liblzma::liblzma)
+ endif ()
+ endif ()
+
+ # Fall back to CMake's FindLibLZMA module for traditional installations.
+ if ("${TSFILE_LIBLZMA_SYSTEM_TARGET}" STREQUAL "")
+ find_package(LibLZMA ${TSFILE_LIBLZMA_MIN_VERSION} MODULE QUIET)
+ if (LibLZMA_FOUND)
+ if (DEFINED LibLZMA_VERSION)
+ set(_TSFILE_SYSTEM_LIBLZMA_VERSION "${LibLZMA_VERSION}")
+ elseif (DEFINED LIBLZMA_VERSION)
+ set(_TSFILE_SYSTEM_LIBLZMA_VERSION "${LIBLZMA_VERSION}")
+ else ()
+ set(_TSFILE_SYSTEM_LIBLZMA_VERSION
+ "${LIBLZMA_VERSION_STRING}")
+ endif ()
+
+ if (TARGET LibLZMA::LibLZMA)
+ set(TSFILE_LIBLZMA_SYSTEM_TARGET LibLZMA::LibLZMA)
+ else ()
+ # FindLibLZMA only gained its imported target in CMake 3.14.
+ # Keep SYSTEM mode usable with TsFile's CMake 3.11 baseline.
+ add_library(tsfile_system_liblzma INTERFACE)
+ target_include_directories(tsfile_system_liblzma INTERFACE
+ ${LIBLZMA_INCLUDE_DIRS})
+ target_link_libraries(tsfile_system_liblzma INTERFACE
+ ${LIBLZMA_LIBRARIES})
+ set(TSFILE_LIBLZMA_SYSTEM_TARGET tsfile_system_liblzma)
+ endif ()
+ endif ()
+ endif ()
+
+ if (NOT "${TSFILE_LIBLZMA_SYSTEM_TARGET}" STREQUAL "" AND
+ NOT "${_TSFILE_SYSTEM_LIBLZMA_VERSION}" STREQUAL "" AND
+ _TSFILE_SYSTEM_LIBLZMA_VERSION VERSION_LESS
+ TSFILE_LIBLZMA_NEXT_INCOMPATIBLE_VERSION)
+ set(_TSFILE_SYSTEM_LIBLZMA_FOUND TRUE)
+ message(STATUS
+ "Found compatible system liblzma "
+ "${_TSFILE_SYSTEM_LIBLZMA_VERSION}")
+ elseif (NOT "${TSFILE_LIBLZMA_SYSTEM_TARGET}" STREQUAL "")
+ message(STATUS
+ "Ignoring incompatible system liblzma "
+ "${_TSFILE_SYSTEM_LIBLZMA_VERSION}; TsFile requires "
+ ">=${TSFILE_LIBLZMA_MIN_VERSION} and "
+ "<${TSFILE_LIBLZMA_NEXT_INCOMPATIBLE_VERSION}")
+ set(TSFILE_LIBLZMA_SYSTEM_TARGET "")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "liblzma" "${_TSFILE_SYSTEM_LIBLZMA_FOUND}" TSFILE_LIBLZMA_SOURCE)
+
+unset(_TSFILE_SYSTEM_LIBLZMA_FOUND)
+unset(_TSFILE_SYSTEM_LIBLZMA_VERSION)
diff --git a/cpp/cmake/LibLZMASource.cmake b/cpp/cmake/LibLZMASource.cmake
new file mode 100644
index 000000000..8f3796348
--- /dev/null
+++ b/cpp/cmake/LibLZMASource.cmake
@@ -0,0 +1,177 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_LIBLZMA_ARCHIVE_NAME
+ "xz-${TSFILE_LIBLZMA_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_LIBLZMA_URL
+ "https://github.com/tukaani-project/xz/releases/download/v${TSFILE_LIBLZMA_BUNDLED_VERSION}/${_TSFILE_LIBLZMA_ARCHIVE_NAME}")
+set(_TSFILE_LIBLZMA_SHA256
+ "3d3a1b973af218114f4f889bbaa2f4c037deaae0c8e815eec381c3d546b974a0")
+set(TSFILE_LIBLZMA_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded XZ source archive for liblzma")
+
+if (TSFILE_LIBLZMA_ARCHIVE)
+ get_filename_component(_TSFILE_LIBLZMA_ARCHIVE
+ "${TSFILE_LIBLZMA_ARCHIVE}" ABSOLUTE
+ BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_LIBLZMA_ARCHIVE}")
+ message(FATAL_ERROR
+ "TSFILE_LIBLZMA_ARCHIVE does not exist: "
+ "${_TSFILE_LIBLZMA_ARCHIVE}")
+ endif ()
+else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_LIBLZMA_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${_TSFILE_LIBLZMA_ARCHIVE_NAME}")
+endif ()
+
+set(_TSFILE_LIBLZMA_ARCHIVE_VALID FALSE)
+if (EXISTS "${_TSFILE_LIBLZMA_ARCHIVE}")
+ file(SHA256 "${_TSFILE_LIBLZMA_ARCHIVE}"
+ _TSFILE_LIBLZMA_ACTUAL_SHA256)
+ if (_TSFILE_LIBLZMA_ACTUAL_SHA256 STREQUAL _TSFILE_LIBLZMA_SHA256)
+ set(_TSFILE_LIBLZMA_ARCHIVE_VALID TRUE)
+ elseif (TSFILE_LIBLZMA_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "XZ source archive for liblzma has an unexpected SHA-256: "
+ "${_TSFILE_LIBLZMA_ARCHIVE}\n"
+ "Expected: ${_TSFILE_LIBLZMA_SHA256}\n"
+ "Actual: ${_TSFILE_LIBLZMA_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached XZ archive: "
+ "${_TSFILE_LIBLZMA_ARCHIVE}")
+ file(REMOVE "${_TSFILE_LIBLZMA_ARCHIVE}")
+ endif ()
+endif ()
+
+if (NOT _TSFILE_LIBLZMA_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified XZ archive "
+ "for liblzma at ${_TSFILE_LIBLZMA_ARCHIVE}. Pre-download "
+ "${_TSFILE_LIBLZMA_URL} or set TSFILE_LIBLZMA_ARCHIVE to a "
+ "verified local archive.")
+ endif ()
+
+ set(_TSFILE_LIBLZMA_PARTIAL_ARCHIVE
+ "${_TSFILE_LIBLZMA_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_LIBLZMA_PARTIAL_ARCHIVE}")
+ message(STATUS
+ "Downloading XZ Utils v${TSFILE_LIBLZMA_BUNDLED_VERSION} "
+ "for liblzma")
+ file(DOWNLOAD
+ "${_TSFILE_LIBLZMA_URL}"
+ "${_TSFILE_LIBLZMA_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_LIBLZMA_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_LIBLZMA_DOWNLOAD_STATUS 0
+ _TSFILE_LIBLZMA_DOWNLOAD_RESULT)
+ list(GET _TSFILE_LIBLZMA_DOWNLOAD_STATUS 1
+ _TSFILE_LIBLZMA_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_LIBLZMA_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_LIBLZMA_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download XZ Utils from ${_TSFILE_LIBLZMA_URL}: "
+ "${_TSFILE_LIBLZMA_DOWNLOAD_MESSAGE}. To build without "
+ "network access, provide ${_TSFILE_LIBLZMA_ARCHIVE_NAME} "
+ "in TSFILE_DEPENDENCY_CACHE or set TSFILE_LIBLZMA_ARCHIVE.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_LIBLZMA_PARTIAL_ARCHIVE}"
+ _TSFILE_LIBLZMA_ACTUAL_SHA256)
+ if (NOT _TSFILE_LIBLZMA_ACTUAL_SHA256 STREQUAL
+ _TSFILE_LIBLZMA_SHA256)
+ file(REMOVE "${_TSFILE_LIBLZMA_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded XZ archive has an unexpected SHA-256. Expected "
+ "${_TSFILE_LIBLZMA_SHA256}, got "
+ "${_TSFILE_LIBLZMA_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_LIBLZMA_PARTIAL_ARCHIVE}"
+ "${_TSFILE_LIBLZMA_ARCHIVE}")
+endif ()
+
+set(_TSFILE_LIBLZMA_EXTRACT_ROOT "${CMAKE_BINARY_DIR}/_deps")
+set(TSFILE_LIBLZMA_SOURCE_DIR
+ "${_TSFILE_LIBLZMA_EXTRACT_ROOT}/xz-${TSFILE_LIBLZMA_BUNDLED_VERSION}")
+set(_TSFILE_LIBLZMA_STAMP
+ "${TSFILE_LIBLZMA_SOURCE_DIR}/.tsfile-archive-sha256")
+set(_TSFILE_LIBLZMA_EXTRACTED FALSE)
+if (EXISTS "${_TSFILE_LIBLZMA_STAMP}" AND
+ EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/CMakeLists.txt" AND
+ EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/src/liblzma/api/lzma.h" AND
+ EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/src/liblzma/lzma/lzma2_encoder.c" AND
+ EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/COPYING.0BSD")
+ file(READ "${_TSFILE_LIBLZMA_STAMP}" _TSFILE_LIBLZMA_STAMP_SHA256)
+ string(STRIP "${_TSFILE_LIBLZMA_STAMP_SHA256}"
+ _TSFILE_LIBLZMA_STAMP_SHA256)
+ if (_TSFILE_LIBLZMA_STAMP_SHA256 STREQUAL _TSFILE_LIBLZMA_SHA256)
+ set(_TSFILE_LIBLZMA_EXTRACTED TRUE)
+ endif ()
+endif ()
+
+if (NOT _TSFILE_LIBLZMA_EXTRACTED)
+ file(REMOVE_RECURSE "${TSFILE_LIBLZMA_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_LIBLZMA_EXTRACT_ROOT}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf
+ "${_TSFILE_LIBLZMA_ARCHIVE}"
+ WORKING_DIRECTORY "${_TSFILE_LIBLZMA_EXTRACT_ROOT}"
+ RESULT_VARIABLE _TSFILE_LIBLZMA_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_LIBLZMA_EXTRACT_ERROR)
+ if (NOT _TSFILE_LIBLZMA_EXTRACT_RESULT EQUAL 0 OR
+ NOT EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/CMakeLists.txt" OR
+ NOT EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/src/liblzma/api/lzma.h" OR
+ NOT EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/src/liblzma/lzma/lzma2_encoder.c" OR
+ NOT EXISTS "${TSFILE_LIBLZMA_SOURCE_DIR}/COPYING.0BSD")
+ file(REMOVE_RECURSE "${TSFILE_LIBLZMA_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the XZ source archive for liblzma: "
+ "${_TSFILE_LIBLZMA_EXTRACT_ERROR}")
+ endif ()
+ file(WRITE "${_TSFILE_LIBLZMA_STAMP}"
+ "${_TSFILE_LIBLZMA_SHA256}\n")
+endif ()
+
+set(TSFILE_LIBLZMA_LICENSE_FILE
+ "${TSFILE_LIBLZMA_SOURCE_DIR}/COPYING.0BSD")
+message(STATUS
+ "Using verified XZ Utils v${TSFILE_LIBLZMA_BUNDLED_VERSION} source "
+ "for the 0BSD liblzma target from ${_TSFILE_LIBLZMA_ARCHIVE}")
+
+unset(_TSFILE_LIBLZMA_ACTUAL_SHA256)
+unset(_TSFILE_LIBLZMA_ARCHIVE)
+unset(_TSFILE_LIBLZMA_ARCHIVE_NAME)
+unset(_TSFILE_LIBLZMA_ARCHIVE_VALID)
+unset(_TSFILE_LIBLZMA_DOWNLOAD_MESSAGE)
+unset(_TSFILE_LIBLZMA_DOWNLOAD_RESULT)
+unset(_TSFILE_LIBLZMA_DOWNLOAD_STATUS)
+unset(_TSFILE_LIBLZMA_EXTRACT_ERROR)
+unset(_TSFILE_LIBLZMA_EXTRACT_RESULT)
+unset(_TSFILE_LIBLZMA_EXTRACT_ROOT)
+unset(_TSFILE_LIBLZMA_EXTRACTED)
+unset(_TSFILE_LIBLZMA_PARTIAL_ARCHIVE)
+unset(_TSFILE_LIBLZMA_SHA256)
+unset(_TSFILE_LIBLZMA_STAMP)
+unset(_TSFILE_LIBLZMA_STAMP_SHA256)
+unset(_TSFILE_LIBLZMA_URL)
diff --git a/cpp/cmake/SIMDeDependency.cmake b/cpp/cmake/SIMDeDependency.cmake
new file mode 100644
index 000000000..c26465681
--- /dev/null
+++ b/cpp/cmake/SIMDeDependency.cmake
@@ -0,0 +1,120 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_SIMDE_MIN_VERSION "0.8.4")
+set(TSFILE_SIMDE_BUNDLED_VERSION "0.8.4-rc3")
+set(TSFILE_SIMDE_NEXT_INCOMPATIBLE_VERSION "1.0.0")
+set(_TSFILE_SYSTEM_SIMDE_FOUND FALSE)
+
+function(_tsfile_read_simde_version INCLUDE_DIR OUT_VERSION)
+ set(_TSFILE_SIMDE_VERSION_HEADER
+ "${INCLUDE_DIR}/simde/simde-common.h")
+ if (NOT EXISTS "${_TSFILE_SIMDE_VERSION_HEADER}")
+ set(${OUT_VERSION} "" PARENT_SCOPE)
+ return()
+ endif ()
+
+ file(STRINGS "${_TSFILE_SIMDE_VERSION_HEADER}"
+ _TSFILE_SIMDE_VERSION_LINES
+ REGEX "^#define SIMDE_VERSION_(MAJOR|MINOR|MICRO) [0-9]+$")
+ foreach (_TSFILE_SIMDE_COMPONENT MAJOR MINOR MICRO)
+ string(REGEX MATCH
+ "SIMDE_VERSION_${_TSFILE_SIMDE_COMPONENT} ([0-9]+)"
+ _TSFILE_SIMDE_MATCH "${_TSFILE_SIMDE_VERSION_LINES}")
+ set(_TSFILE_SIMDE_${_TSFILE_SIMDE_COMPONENT}
+ "${CMAKE_MATCH_1}")
+ endforeach ()
+
+ if (NOT "${_TSFILE_SIMDE_MAJOR}" STREQUAL "" AND
+ NOT "${_TSFILE_SIMDE_MINOR}" STREQUAL "" AND
+ NOT "${_TSFILE_SIMDE_MICRO}" STREQUAL "")
+ set(${OUT_VERSION}
+ "${_TSFILE_SIMDE_MAJOR}.${_TSFILE_SIMDE_MINOR}.${_TSFILE_SIMDE_MICRO}"
+ PARENT_SCOPE)
+ else ()
+ set(${OUT_VERSION} "" PARENT_SCOPE)
+ endif ()
+endfunction()
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ cmake_policy(PUSH)
+ if (POLICY CMP0144)
+ cmake_policy(SET CMP0144 NEW)
+ endif ()
+ find_package(simde CONFIG QUIET)
+ cmake_policy(POP)
+ if (simde_FOUND AND TARGET simde::simde AND
+ NOT "${simde_VERSION}" STREQUAL "")
+ set(_TSFILE_SYSTEM_SIMDE_VERSION "${simde_VERSION}")
+ endif ()
+
+ if (NOT TARGET simde::simde)
+ find_path(TSFILE_SYSTEM_SIMDE_INCLUDE_DIR
+ NAMES simde/x86/ssse3.h
+ HINTS "${SIMDE_ROOT}" "$ENV{SIMDE_ROOT}"
+ PATH_SUFFIXES include)
+ if (TSFILE_SYSTEM_SIMDE_INCLUDE_DIR)
+ _tsfile_read_simde_version(
+ "${TSFILE_SYSTEM_SIMDE_INCLUDE_DIR}"
+ _TSFILE_SYSTEM_SIMDE_VERSION)
+ endif ()
+ elseif ("${_TSFILE_SYSTEM_SIMDE_VERSION}" STREQUAL "")
+ get_target_property(_TSFILE_SIMDE_INCLUDE_DIRS simde::simde
+ INTERFACE_INCLUDE_DIRECTORIES)
+ foreach (_TSFILE_SIMDE_INCLUDE_DIR ${_TSFILE_SIMDE_INCLUDE_DIRS})
+ if (NOT _TSFILE_SIMDE_INCLUDE_DIR MATCHES "^\\$<")
+ _tsfile_read_simde_version("${_TSFILE_SIMDE_INCLUDE_DIR}"
+ _TSFILE_SYSTEM_SIMDE_VERSION)
+ if (NOT "${_TSFILE_SYSTEM_SIMDE_VERSION}" STREQUAL "")
+ break()
+ endif ()
+ endif ()
+ endforeach ()
+ endif ()
+
+ if (NOT "${_TSFILE_SYSTEM_SIMDE_VERSION}" STREQUAL "" AND
+ NOT _TSFILE_SYSTEM_SIMDE_VERSION VERSION_LESS
+ TSFILE_SIMDE_MIN_VERSION AND
+ _TSFILE_SYSTEM_SIMDE_VERSION VERSION_LESS
+ TSFILE_SIMDE_NEXT_INCOMPATIBLE_VERSION)
+ if (NOT TARGET simde::simde)
+ add_library(tsfile_system_simde INTERFACE)
+ target_include_directories(tsfile_system_simde INTERFACE
+ "${TSFILE_SYSTEM_SIMDE_INCLUDE_DIR}")
+ add_library(simde::simde ALIAS tsfile_system_simde)
+ endif ()
+ set(_TSFILE_SYSTEM_SIMDE_FOUND TRUE)
+ message(STATUS
+ "Found compatible system SIMDe ${_TSFILE_SYSTEM_SIMDE_VERSION}")
+ elseif (TARGET simde::simde OR TSFILE_SYSTEM_SIMDE_INCLUDE_DIR)
+ message(STATUS
+ "Ignoring incompatible system SIMDe "
+ "${_TSFILE_SYSTEM_SIMDE_VERSION}; TsFile requires "
+ ">=${TSFILE_SIMDE_MIN_VERSION} and "
+ "<${TSFILE_SIMDE_NEXT_INCOMPATIBLE_VERSION}")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "SIMDe" "${_TSFILE_SYSTEM_SIMDE_FOUND}" TSFILE_SIMDE_SOURCE)
+
+unset(_TSFILE_SIMDE_INCLUDE_DIR)
+unset(_TSFILE_SIMDE_INCLUDE_DIRS)
+unset(_TSFILE_SYSTEM_SIMDE_FOUND)
+unset(_TSFILE_SYSTEM_SIMDE_VERSION)
diff --git a/cpp/cmake/SIMDeSource.cmake b/cpp/cmake/SIMDeSource.cmake
new file mode 100644
index 000000000..e4ca98be4
--- /dev/null
+++ b/cpp/cmake/SIMDeSource.cmake
@@ -0,0 +1,169 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_SIMDE_ARCHIVE_NAME
+ "simde-v${TSFILE_SIMDE_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_SIMDE_URL
+ "https://github.com/simd-everywhere/simde/archive/refs/tags/v${TSFILE_SIMDE_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_SIMDE_SHA256
+ "a5407985439fef1435ac1f091a4d2e6c71981faed213e1be156aca575ce7052c")
+set(TSFILE_SIMDE_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded SIMDe source archive")
+
+if (TSFILE_SIMDE_ARCHIVE)
+ get_filename_component(_TSFILE_SIMDE_ARCHIVE
+ "${TSFILE_SIMDE_ARCHIVE}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_SIMDE_ARCHIVE}")
+ message(FATAL_ERROR
+ "TSFILE_SIMDE_ARCHIVE does not exist: "
+ "${_TSFILE_SIMDE_ARCHIVE}")
+ endif ()
+else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_SIMDE_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${_TSFILE_SIMDE_ARCHIVE_NAME}")
+endif ()
+
+set(_TSFILE_SIMDE_ARCHIVE_VALID FALSE)
+if (EXISTS "${_TSFILE_SIMDE_ARCHIVE}")
+ file(SHA256 "${_TSFILE_SIMDE_ARCHIVE}"
+ _TSFILE_SIMDE_ACTUAL_SHA256)
+ if (_TSFILE_SIMDE_ACTUAL_SHA256 STREQUAL _TSFILE_SIMDE_SHA256)
+ set(_TSFILE_SIMDE_ARCHIVE_VALID TRUE)
+ elseif (TSFILE_SIMDE_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "SIMDe source archive has an unexpected SHA-256: "
+ "${_TSFILE_SIMDE_ARCHIVE}\n"
+ "Expected: ${_TSFILE_SIMDE_SHA256}\n"
+ "Actual: ${_TSFILE_SIMDE_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached SIMDe archive: "
+ "${_TSFILE_SIMDE_ARCHIVE}")
+ file(REMOVE "${_TSFILE_SIMDE_ARCHIVE}")
+ endif ()
+endif ()
+
+if (NOT _TSFILE_SIMDE_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified SIMDe "
+ "archive at ${_TSFILE_SIMDE_ARCHIVE}. Pre-download "
+ "${_TSFILE_SIMDE_URL} or set TSFILE_SIMDE_ARCHIVE to a "
+ "verified local archive.")
+ endif ()
+
+ set(_TSFILE_SIMDE_PARTIAL_ARCHIVE
+ "${_TSFILE_SIMDE_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_SIMDE_PARTIAL_ARCHIVE}")
+ message(STATUS "Downloading SIMDe v${TSFILE_SIMDE_BUNDLED_VERSION}")
+ file(DOWNLOAD
+ "${_TSFILE_SIMDE_URL}"
+ "${_TSFILE_SIMDE_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_SIMDE_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_SIMDE_DOWNLOAD_STATUS 0
+ _TSFILE_SIMDE_DOWNLOAD_RESULT)
+ list(GET _TSFILE_SIMDE_DOWNLOAD_STATUS 1
+ _TSFILE_SIMDE_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_SIMDE_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_SIMDE_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download SIMDe from ${_TSFILE_SIMDE_URL}: "
+ "${_TSFILE_SIMDE_DOWNLOAD_MESSAGE}. To build without "
+ "network access, provide ${_TSFILE_SIMDE_ARCHIVE_NAME} in "
+ "TSFILE_DEPENDENCY_CACHE or set TSFILE_SIMDE_ARCHIVE.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_SIMDE_PARTIAL_ARCHIVE}"
+ _TSFILE_SIMDE_ACTUAL_SHA256)
+ if (NOT _TSFILE_SIMDE_ACTUAL_SHA256 STREQUAL _TSFILE_SIMDE_SHA256)
+ file(REMOVE "${_TSFILE_SIMDE_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded SIMDe archive has an unexpected SHA-256. "
+ "Expected ${_TSFILE_SIMDE_SHA256}, got "
+ "${_TSFILE_SIMDE_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_SIMDE_PARTIAL_ARCHIVE}"
+ "${_TSFILE_SIMDE_ARCHIVE}")
+endif ()
+
+set(_TSFILE_SIMDE_EXTRACT_ROOT "${CMAKE_BINARY_DIR}/_deps")
+set(TSFILE_SIMDE_SOURCE_DIR
+ "${_TSFILE_SIMDE_EXTRACT_ROOT}/simde-${TSFILE_SIMDE_BUNDLED_VERSION}")
+set(_TSFILE_SIMDE_STAMP
+ "${TSFILE_SIMDE_SOURCE_DIR}/.tsfile-archive-sha256")
+set(_TSFILE_SIMDE_EXTRACTED FALSE)
+if (EXISTS "${_TSFILE_SIMDE_STAMP}" AND
+ EXISTS "${TSFILE_SIMDE_SOURCE_DIR}/simde/simde-common.h" AND
+ EXISTS "${TSFILE_SIMDE_SOURCE_DIR}/simde/x86/ssse3.h" AND
+ EXISTS "${TSFILE_SIMDE_SOURCE_DIR}/COPYING")
+ file(READ "${_TSFILE_SIMDE_STAMP}" _TSFILE_SIMDE_STAMP_SHA256)
+ string(STRIP "${_TSFILE_SIMDE_STAMP_SHA256}"
+ _TSFILE_SIMDE_STAMP_SHA256)
+ if (_TSFILE_SIMDE_STAMP_SHA256 STREQUAL _TSFILE_SIMDE_SHA256)
+ set(_TSFILE_SIMDE_EXTRACTED TRUE)
+ endif ()
+endif ()
+
+if (NOT _TSFILE_SIMDE_EXTRACTED)
+ file(REMOVE_RECURSE "${TSFILE_SIMDE_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_SIMDE_EXTRACT_ROOT}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf
+ "${_TSFILE_SIMDE_ARCHIVE}"
+ WORKING_DIRECTORY "${_TSFILE_SIMDE_EXTRACT_ROOT}"
+ RESULT_VARIABLE _TSFILE_SIMDE_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_SIMDE_EXTRACT_ERROR)
+ if (NOT _TSFILE_SIMDE_EXTRACT_RESULT EQUAL 0 OR
+ NOT EXISTS "${TSFILE_SIMDE_SOURCE_DIR}/simde/simde-common.h" OR
+ NOT EXISTS "${TSFILE_SIMDE_SOURCE_DIR}/simde/x86/ssse3.h" OR
+ NOT EXISTS "${TSFILE_SIMDE_SOURCE_DIR}/COPYING")
+ file(REMOVE_RECURSE "${TSFILE_SIMDE_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the SIMDe source archive: "
+ "${_TSFILE_SIMDE_EXTRACT_ERROR}")
+ endif ()
+ file(WRITE "${_TSFILE_SIMDE_STAMP}" "${_TSFILE_SIMDE_SHA256}\n")
+endif ()
+
+set(TSFILE_SIMDE_LICENSE_FILE "${TSFILE_SIMDE_SOURCE_DIR}/COPYING")
+message(STATUS
+ "Using verified SIMDe v${TSFILE_SIMDE_BUNDLED_VERSION} source from "
+ "${_TSFILE_SIMDE_ARCHIVE}")
+
+unset(_TSFILE_SIMDE_ACTUAL_SHA256)
+unset(_TSFILE_SIMDE_ARCHIVE)
+unset(_TSFILE_SIMDE_ARCHIVE_NAME)
+unset(_TSFILE_SIMDE_ARCHIVE_VALID)
+unset(_TSFILE_SIMDE_DOWNLOAD_MESSAGE)
+unset(_TSFILE_SIMDE_DOWNLOAD_RESULT)
+unset(_TSFILE_SIMDE_DOWNLOAD_STATUS)
+unset(_TSFILE_SIMDE_EXTRACT_ERROR)
+unset(_TSFILE_SIMDE_EXTRACT_RESULT)
+unset(_TSFILE_SIMDE_EXTRACT_ROOT)
+unset(_TSFILE_SIMDE_EXTRACTED)
+unset(_TSFILE_SIMDE_PARTIAL_ARCHIVE)
+unset(_TSFILE_SIMDE_SHA256)
+unset(_TSFILE_SIMDE_STAMP)
+unset(_TSFILE_SIMDE_STAMP_SHA256)
+unset(_TSFILE_SIMDE_URL)
diff --git a/cpp/cmake/SnappyDependency.cmake b/cpp/cmake/SnappyDependency.cmake
new file mode 100644
index 000000000..37f63a503
--- /dev/null
+++ b/cpp/cmake/SnappyDependency.cmake
@@ -0,0 +1,44 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_SNAPPY_MIN_VERSION "1.2.1")
+set(TSFILE_SNAPPY_BUNDLED_VERSION "1.2.2")
+set(TSFILE_SNAPPY_NEXT_INCOMPATIBLE_VERSION "2.0.0")
+set(_TSFILE_SYSTEM_SNAPPY_FOUND FALSE)
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ find_package(Snappy ${TSFILE_SNAPPY_MIN_VERSION} CONFIG QUIET)
+ if (Snappy_FOUND AND TARGET Snappy::snappy AND
+ NOT "${Snappy_VERSION}" STREQUAL "" AND
+ Snappy_VERSION VERSION_LESS
+ TSFILE_SNAPPY_NEXT_INCOMPATIBLE_VERSION)
+ set(_TSFILE_SYSTEM_SNAPPY_FOUND TRUE)
+ message(STATUS "Found compatible system Snappy ${Snappy_VERSION}")
+ elseif (Snappy_FOUND)
+ message(STATUS
+ "Ignoring incompatible system Snappy ${Snappy_VERSION}; "
+ "TsFile requires >=${TSFILE_SNAPPY_MIN_VERSION} and "
+ "<${TSFILE_SNAPPY_NEXT_INCOMPATIBLE_VERSION}")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "Snappy" "${_TSFILE_SYSTEM_SNAPPY_FOUND}" TSFILE_SNAPPY_SOURCE)
+
+unset(_TSFILE_SYSTEM_SNAPPY_FOUND)
diff --git a/cpp/cmake/SnappySource.cmake b/cpp/cmake/SnappySource.cmake
new file mode 100644
index 000000000..f7aead85b
--- /dev/null
+++ b/cpp/cmake/SnappySource.cmake
@@ -0,0 +1,171 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_SNAPPY_ARCHIVE_NAME
+ "snappy-${TSFILE_SNAPPY_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_SNAPPY_URL
+ "https://github.com/google/snappy/archive/refs/tags/${TSFILE_SNAPPY_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_SNAPPY_SHA256
+ "90f74bc1fbf78a6c56b3c4a082a05103b3a56bb17bca1a27e052ea11723292dc")
+set(TSFILE_SNAPPY_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded Snappy source archive")
+
+if (TSFILE_SNAPPY_ARCHIVE)
+ get_filename_component(_TSFILE_SNAPPY_ARCHIVE
+ "${TSFILE_SNAPPY_ARCHIVE}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_SNAPPY_ARCHIVE}")
+ message(FATAL_ERROR
+ "TSFILE_SNAPPY_ARCHIVE does not exist: "
+ "${_TSFILE_SNAPPY_ARCHIVE}")
+ endif ()
+else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_SNAPPY_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${_TSFILE_SNAPPY_ARCHIVE_NAME}")
+endif ()
+
+set(_TSFILE_SNAPPY_ARCHIVE_VALID FALSE)
+if (EXISTS "${_TSFILE_SNAPPY_ARCHIVE}")
+ file(SHA256 "${_TSFILE_SNAPPY_ARCHIVE}"
+ _TSFILE_SNAPPY_ACTUAL_SHA256)
+ if (_TSFILE_SNAPPY_ACTUAL_SHA256 STREQUAL _TSFILE_SNAPPY_SHA256)
+ set(_TSFILE_SNAPPY_ARCHIVE_VALID TRUE)
+ elseif (TSFILE_SNAPPY_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Snappy source archive has an unexpected SHA-256: "
+ "${_TSFILE_SNAPPY_ARCHIVE}\n"
+ "Expected: ${_TSFILE_SNAPPY_SHA256}\n"
+ "Actual: ${_TSFILE_SNAPPY_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached Snappy archive: "
+ "${_TSFILE_SNAPPY_ARCHIVE}")
+ file(REMOVE "${_TSFILE_SNAPPY_ARCHIVE}")
+ endif ()
+endif ()
+
+if (NOT _TSFILE_SNAPPY_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified Snappy "
+ "archive at ${_TSFILE_SNAPPY_ARCHIVE}. Pre-download "
+ "${_TSFILE_SNAPPY_URL} or set TSFILE_SNAPPY_ARCHIVE to a "
+ "verified local archive.")
+ endif ()
+
+ set(_TSFILE_SNAPPY_PARTIAL_ARCHIVE
+ "${_TSFILE_SNAPPY_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_SNAPPY_PARTIAL_ARCHIVE}")
+ message(STATUS "Downloading Snappy v${TSFILE_SNAPPY_BUNDLED_VERSION}")
+ file(DOWNLOAD
+ "${_TSFILE_SNAPPY_URL}"
+ "${_TSFILE_SNAPPY_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_SNAPPY_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_SNAPPY_DOWNLOAD_STATUS 0
+ _TSFILE_SNAPPY_DOWNLOAD_RESULT)
+ list(GET _TSFILE_SNAPPY_DOWNLOAD_STATUS 1
+ _TSFILE_SNAPPY_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_SNAPPY_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_SNAPPY_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download Snappy from ${_TSFILE_SNAPPY_URL}: "
+ "${_TSFILE_SNAPPY_DOWNLOAD_MESSAGE}. To build without "
+ "network access, provide ${_TSFILE_SNAPPY_ARCHIVE_NAME} in "
+ "TSFILE_DEPENDENCY_CACHE or set TSFILE_SNAPPY_ARCHIVE.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_SNAPPY_PARTIAL_ARCHIVE}"
+ _TSFILE_SNAPPY_ACTUAL_SHA256)
+ if (NOT _TSFILE_SNAPPY_ACTUAL_SHA256 STREQUAL _TSFILE_SNAPPY_SHA256)
+ file(REMOVE "${_TSFILE_SNAPPY_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded Snappy archive has an unexpected SHA-256. "
+ "Expected ${_TSFILE_SNAPPY_SHA256}, got "
+ "${_TSFILE_SNAPPY_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_SNAPPY_PARTIAL_ARCHIVE}"
+ "${_TSFILE_SNAPPY_ARCHIVE}")
+endif ()
+
+set(_TSFILE_SNAPPY_EXTRACT_ROOT "${CMAKE_BINARY_DIR}/_deps")
+set(TSFILE_SNAPPY_SOURCE_DIR
+ "${_TSFILE_SNAPPY_EXTRACT_ROOT}/snappy-${TSFILE_SNAPPY_BUNDLED_VERSION}")
+set(_TSFILE_SNAPPY_STAMP
+ "${TSFILE_SNAPPY_SOURCE_DIR}/.tsfile-archive-sha256")
+set(_TSFILE_SNAPPY_EXTRACTED FALSE)
+if (EXISTS "${_TSFILE_SNAPPY_STAMP}" AND
+ EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/CMakeLists.txt" AND
+ EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/snappy.cc" AND
+ EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/snappy.h" AND
+ EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/COPYING")
+ file(READ "${_TSFILE_SNAPPY_STAMP}" _TSFILE_SNAPPY_STAMP_SHA256)
+ string(STRIP "${_TSFILE_SNAPPY_STAMP_SHA256}"
+ _TSFILE_SNAPPY_STAMP_SHA256)
+ if (_TSFILE_SNAPPY_STAMP_SHA256 STREQUAL _TSFILE_SNAPPY_SHA256)
+ set(_TSFILE_SNAPPY_EXTRACTED TRUE)
+ endif ()
+endif ()
+
+if (NOT _TSFILE_SNAPPY_EXTRACTED)
+ file(REMOVE_RECURSE "${TSFILE_SNAPPY_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_SNAPPY_EXTRACT_ROOT}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf
+ "${_TSFILE_SNAPPY_ARCHIVE}"
+ WORKING_DIRECTORY "${_TSFILE_SNAPPY_EXTRACT_ROOT}"
+ RESULT_VARIABLE _TSFILE_SNAPPY_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_SNAPPY_EXTRACT_ERROR)
+ if (NOT _TSFILE_SNAPPY_EXTRACT_RESULT EQUAL 0 OR
+ NOT EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/CMakeLists.txt" OR
+ NOT EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/snappy.cc" OR
+ NOT EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/snappy.h" OR
+ NOT EXISTS "${TSFILE_SNAPPY_SOURCE_DIR}/COPYING")
+ file(REMOVE_RECURSE "${TSFILE_SNAPPY_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the Snappy source archive: "
+ "${_TSFILE_SNAPPY_EXTRACT_ERROR}")
+ endif ()
+ file(WRITE "${_TSFILE_SNAPPY_STAMP}" "${_TSFILE_SNAPPY_SHA256}\n")
+endif ()
+
+set(TSFILE_SNAPPY_LICENSE_FILE "${TSFILE_SNAPPY_SOURCE_DIR}/COPYING")
+message(STATUS
+ "Using verified Snappy v${TSFILE_SNAPPY_BUNDLED_VERSION} source from "
+ "${_TSFILE_SNAPPY_ARCHIVE}")
+
+unset(_TSFILE_SNAPPY_ACTUAL_SHA256)
+unset(_TSFILE_SNAPPY_ARCHIVE)
+unset(_TSFILE_SNAPPY_ARCHIVE_NAME)
+unset(_TSFILE_SNAPPY_ARCHIVE_VALID)
+unset(_TSFILE_SNAPPY_DOWNLOAD_MESSAGE)
+unset(_TSFILE_SNAPPY_DOWNLOAD_RESULT)
+unset(_TSFILE_SNAPPY_DOWNLOAD_STATUS)
+unset(_TSFILE_SNAPPY_EXTRACT_ERROR)
+unset(_TSFILE_SNAPPY_EXTRACT_RESULT)
+unset(_TSFILE_SNAPPY_EXTRACT_ROOT)
+unset(_TSFILE_SNAPPY_EXTRACTED)
+unset(_TSFILE_SNAPPY_PARTIAL_ARCHIVE)
+unset(_TSFILE_SNAPPY_SHA256)
+unset(_TSFILE_SNAPPY_STAMP)
+unset(_TSFILE_SNAPPY_STAMP_SHA256)
+unset(_TSFILE_SNAPPY_URL)
diff --git a/cpp/cmake/ZLIBDependency.cmake b/cpp/cmake/ZLIBDependency.cmake
new file mode 100644
index 000000000..619949ed0
--- /dev/null
+++ b/cpp/cmake/ZLIBDependency.cmake
@@ -0,0 +1,55 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_ZLIB_MIN_VERSION "1.3.1")
+set(TSFILE_ZLIB_BUNDLED_VERSION "1.3.1")
+set(TSFILE_ZLIB_NEXT_INCOMPATIBLE_VERSION "2.0.0")
+set(_TSFILE_SYSTEM_ZLIB_FOUND FALSE)
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ find_package(ZLIB QUIET)
+ if (ZLIB_VERSION)
+ set(_TSFILE_SYSTEM_ZLIB_VERSION "${ZLIB_VERSION}")
+ else ()
+ set(_TSFILE_SYSTEM_ZLIB_VERSION "${ZLIB_VERSION_STRING}")
+ endif ()
+
+ if (ZLIB_FOUND AND TARGET ZLIB::ZLIB AND
+ NOT "${_TSFILE_SYSTEM_ZLIB_VERSION}" STREQUAL "" AND
+ NOT _TSFILE_SYSTEM_ZLIB_VERSION VERSION_LESS
+ TSFILE_ZLIB_MIN_VERSION AND
+ _TSFILE_SYSTEM_ZLIB_VERSION VERSION_LESS
+ TSFILE_ZLIB_NEXT_INCOMPATIBLE_VERSION)
+ set(_TSFILE_SYSTEM_ZLIB_FOUND TRUE)
+ message(STATUS
+ "Found compatible system zlib ${_TSFILE_SYSTEM_ZLIB_VERSION}")
+ elseif (ZLIB_FOUND)
+ message(STATUS
+ "Ignoring incompatible system zlib "
+ "${_TSFILE_SYSTEM_ZLIB_VERSION}; TsFile requires "
+ ">=${TSFILE_ZLIB_MIN_VERSION} and "
+ "<${TSFILE_ZLIB_NEXT_INCOMPATIBLE_VERSION}")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "zlib" "${_TSFILE_SYSTEM_ZLIB_FOUND}" TSFILE_ZLIB_SOURCE)
+
+unset(_TSFILE_SYSTEM_ZLIB_FOUND)
+unset(_TSFILE_SYSTEM_ZLIB_VERSION)
diff --git a/cpp/cmake/ZLIBSource.cmake b/cpp/cmake/ZLIBSource.cmake
new file mode 100644
index 000000000..40ca01661
--- /dev/null
+++ b/cpp/cmake/ZLIBSource.cmake
@@ -0,0 +1,163 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_ZLIB_ARCHIVE_NAME
+ "zlib-v${TSFILE_ZLIB_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_ZLIB_URL
+ "https://github.com/madler/zlib/archive/refs/tags/v${TSFILE_ZLIB_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_ZLIB_SHA256
+ "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c")
+set(TSFILE_ZLIB_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded zlib v${TSFILE_ZLIB_BUNDLED_VERSION} source archive")
+
+if (TSFILE_ZLIB_ARCHIVE)
+ get_filename_component(_TSFILE_ZLIB_ARCHIVE
+ "${TSFILE_ZLIB_ARCHIVE}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_ZLIB_ARCHIVE}")
+ message(FATAL_ERROR
+ "TSFILE_ZLIB_ARCHIVE does not exist: ${_TSFILE_ZLIB_ARCHIVE}")
+ endif ()
+else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_ZLIB_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${_TSFILE_ZLIB_ARCHIVE_NAME}")
+endif ()
+
+set(_TSFILE_ZLIB_ARCHIVE_VALID FALSE)
+if (EXISTS "${_TSFILE_ZLIB_ARCHIVE}")
+ file(SHA256 "${_TSFILE_ZLIB_ARCHIVE}" _TSFILE_ZLIB_ACTUAL_SHA256)
+ if (_TSFILE_ZLIB_ACTUAL_SHA256 STREQUAL _TSFILE_ZLIB_SHA256)
+ set(_TSFILE_ZLIB_ARCHIVE_VALID TRUE)
+ elseif (TSFILE_ZLIB_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "zlib source archive has an unexpected SHA-256: "
+ "${_TSFILE_ZLIB_ARCHIVE}\n"
+ "Expected: ${_TSFILE_ZLIB_SHA256}\n"
+ "Actual: ${_TSFILE_ZLIB_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached zlib archive: "
+ "${_TSFILE_ZLIB_ARCHIVE}")
+ file(REMOVE "${_TSFILE_ZLIB_ARCHIVE}")
+ endif ()
+endif ()
+
+if (NOT _TSFILE_ZLIB_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified zlib archive "
+ "at ${_TSFILE_ZLIB_ARCHIVE}. Pre-download "
+ "${_TSFILE_ZLIB_URL} or set TSFILE_ZLIB_ARCHIVE to a "
+ "verified local archive.")
+ endif ()
+
+ set(_TSFILE_ZLIB_PARTIAL_ARCHIVE "${_TSFILE_ZLIB_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_ZLIB_PARTIAL_ARCHIVE}")
+ message(STATUS "Downloading zlib v${TSFILE_ZLIB_BUNDLED_VERSION}")
+ file(DOWNLOAD
+ "${_TSFILE_ZLIB_URL}"
+ "${_TSFILE_ZLIB_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_ZLIB_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_ZLIB_DOWNLOAD_STATUS 0 _TSFILE_ZLIB_DOWNLOAD_RESULT)
+ list(GET _TSFILE_ZLIB_DOWNLOAD_STATUS 1 _TSFILE_ZLIB_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_ZLIB_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_ZLIB_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download zlib from ${_TSFILE_ZLIB_URL}: "
+ "${_TSFILE_ZLIB_DOWNLOAD_MESSAGE}. To build without network "
+ "access, provide ${_TSFILE_ZLIB_ARCHIVE_NAME} in "
+ "TSFILE_DEPENDENCY_CACHE or set TSFILE_ZLIB_ARCHIVE.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_ZLIB_PARTIAL_ARCHIVE}"
+ _TSFILE_ZLIB_ACTUAL_SHA256)
+ if (NOT _TSFILE_ZLIB_ACTUAL_SHA256 STREQUAL _TSFILE_ZLIB_SHA256)
+ file(REMOVE "${_TSFILE_ZLIB_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded zlib archive has an unexpected SHA-256. "
+ "Expected ${_TSFILE_ZLIB_SHA256}, got "
+ "${_TSFILE_ZLIB_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_ZLIB_PARTIAL_ARCHIVE}"
+ "${_TSFILE_ZLIB_ARCHIVE}")
+endif ()
+
+set(_TSFILE_ZLIB_EXTRACT_ROOT "${CMAKE_BINARY_DIR}/_deps")
+set(TSFILE_ZLIB_SOURCE_DIR
+ "${_TSFILE_ZLIB_EXTRACT_ROOT}/zlib-${TSFILE_ZLIB_BUNDLED_VERSION}")
+set(_TSFILE_ZLIB_STAMP
+ "${TSFILE_ZLIB_SOURCE_DIR}/.tsfile-archive-sha256")
+set(_TSFILE_ZLIB_EXTRACTED FALSE)
+if (EXISTS "${_TSFILE_ZLIB_STAMP}" AND
+ EXISTS "${TSFILE_ZLIB_SOURCE_DIR}/CMakeLists.txt" AND
+ EXISTS "${TSFILE_ZLIB_SOURCE_DIR}/zlib.h" AND
+ EXISTS "${TSFILE_ZLIB_SOURCE_DIR}/LICENSE")
+ file(READ "${_TSFILE_ZLIB_STAMP}" _TSFILE_ZLIB_STAMP_SHA256)
+ string(STRIP "${_TSFILE_ZLIB_STAMP_SHA256}"
+ _TSFILE_ZLIB_STAMP_SHA256)
+ if (_TSFILE_ZLIB_STAMP_SHA256 STREQUAL _TSFILE_ZLIB_SHA256)
+ set(_TSFILE_ZLIB_EXTRACTED TRUE)
+ endif ()
+endif ()
+
+if (NOT _TSFILE_ZLIB_EXTRACTED)
+ file(REMOVE_RECURSE "${TSFILE_ZLIB_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_ZLIB_EXTRACT_ROOT}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf "${_TSFILE_ZLIB_ARCHIVE}"
+ WORKING_DIRECTORY "${_TSFILE_ZLIB_EXTRACT_ROOT}"
+ RESULT_VARIABLE _TSFILE_ZLIB_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_ZLIB_EXTRACT_ERROR)
+ if (NOT _TSFILE_ZLIB_EXTRACT_RESULT EQUAL 0 OR
+ NOT EXISTS "${TSFILE_ZLIB_SOURCE_DIR}/CMakeLists.txt" OR
+ NOT EXISTS "${TSFILE_ZLIB_SOURCE_DIR}/zlib.h" OR
+ NOT EXISTS "${TSFILE_ZLIB_SOURCE_DIR}/LICENSE")
+ file(REMOVE_RECURSE "${TSFILE_ZLIB_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the zlib source archive: "
+ "${_TSFILE_ZLIB_EXTRACT_ERROR}")
+ endif ()
+ file(WRITE "${_TSFILE_ZLIB_STAMP}" "${_TSFILE_ZLIB_SHA256}\n")
+endif ()
+
+set(TSFILE_ZLIB_LICENSE_FILE "${TSFILE_ZLIB_SOURCE_DIR}/LICENSE")
+message(STATUS
+ "Using verified zlib v${TSFILE_ZLIB_BUNDLED_VERSION} source from "
+ "${_TSFILE_ZLIB_ARCHIVE}")
+
+unset(_TSFILE_ZLIB_ACTUAL_SHA256)
+unset(_TSFILE_ZLIB_ARCHIVE)
+unset(_TSFILE_ZLIB_ARCHIVE_NAME)
+unset(_TSFILE_ZLIB_ARCHIVE_VALID)
+unset(_TSFILE_ZLIB_DOWNLOAD_MESSAGE)
+unset(_TSFILE_ZLIB_DOWNLOAD_RESULT)
+unset(_TSFILE_ZLIB_DOWNLOAD_STATUS)
+unset(_TSFILE_ZLIB_EXTRACT_ERROR)
+unset(_TSFILE_ZLIB_EXTRACT_RESULT)
+unset(_TSFILE_ZLIB_EXTRACT_ROOT)
+unset(_TSFILE_ZLIB_EXTRACTED)
+unset(_TSFILE_ZLIB_PARTIAL_ARCHIVE)
+unset(_TSFILE_ZLIB_SHA256)
+unset(_TSFILE_ZLIB_STAMP)
+unset(_TSFILE_ZLIB_STAMP_SHA256)
+unset(_TSFILE_ZLIB_URL)
diff --git a/cpp/cmake/ZSTDDependency.cmake b/cpp/cmake/ZSTDDependency.cmake
new file mode 100644
index 000000000..a28bb0a26
--- /dev/null
+++ b/cpp/cmake/ZSTDDependency.cmake
@@ -0,0 +1,57 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(TSFILE_ZSTD_MIN_VERSION "1.5.7")
+set(TSFILE_ZSTD_BUNDLED_VERSION "1.5.7")
+set(TSFILE_ZSTD_NEXT_INCOMPATIBLE_VERSION "2.0.0")
+set(TSFILE_ZSTD_SYSTEM_TARGET "")
+set(_TSFILE_SYSTEM_ZSTD_FOUND FALSE)
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "BUNDLED")
+ find_package(zstd ${TSFILE_ZSTD_MIN_VERSION} CONFIG QUIET)
+ if (zstd_FOUND AND
+ NOT "${zstd_VERSION}" STREQUAL "" AND
+ zstd_VERSION VERSION_LESS
+ TSFILE_ZSTD_NEXT_INCOMPATIBLE_VERSION)
+ foreach (_TSFILE_ZSTD_TARGET
+ zstd::libzstd_static
+ zstd::libzstd_shared
+ zstd::libzstd)
+ if (TARGET ${_TSFILE_ZSTD_TARGET})
+ set(TSFILE_ZSTD_SYSTEM_TARGET ${_TSFILE_ZSTD_TARGET})
+ break()
+ endif ()
+ endforeach ()
+ if (NOT "${TSFILE_ZSTD_SYSTEM_TARGET}" STREQUAL "")
+ set(_TSFILE_SYSTEM_ZSTD_FOUND TRUE)
+ message(STATUS "Found compatible system Zstandard ${zstd_VERSION}")
+ endif ()
+ elseif (zstd_FOUND)
+ message(STATUS
+ "Ignoring incompatible system Zstandard ${zstd_VERSION}; "
+ "TsFile requires >=${TSFILE_ZSTD_MIN_VERSION} and "
+ "<${TSFILE_ZSTD_NEXT_INCOMPATIBLE_VERSION}")
+ endif ()
+endif ()
+
+tsfile_resolve_dependency_source(
+ "Zstandard" "${_TSFILE_SYSTEM_ZSTD_FOUND}" TSFILE_ZSTD_SOURCE)
+
+unset(_TSFILE_SYSTEM_ZSTD_FOUND)
+unset(_TSFILE_ZSTD_TARGET)
diff --git a/cpp/cmake/ZSTDSource.cmake b/cpp/cmake/ZSTDSource.cmake
new file mode 100644
index 000000000..a6c7e10e8
--- /dev/null
+++ b/cpp/cmake/ZSTDSource.cmake
@@ -0,0 +1,170 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_ZSTD_ARCHIVE_NAME
+ "zstd-v${TSFILE_ZSTD_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_ZSTD_URL
+ "https://github.com/facebook/zstd/archive/refs/tags/v${TSFILE_ZSTD_BUNDLED_VERSION}.tar.gz")
+set(_TSFILE_ZSTD_SHA256
+ "37d7284556b20954e56e1ca85b80226768902e2edabd3b649e9e72c0c9012ee3")
+set(TSFILE_ZSTD_ARCHIVE ""
+ CACHE FILEPATH
+ "Optional pre-downloaded Zstandard source archive")
+
+if (TSFILE_ZSTD_ARCHIVE)
+ get_filename_component(_TSFILE_ZSTD_ARCHIVE
+ "${TSFILE_ZSTD_ARCHIVE}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
+ if (NOT EXISTS "${_TSFILE_ZSTD_ARCHIVE}")
+ message(FATAL_ERROR
+ "TSFILE_ZSTD_ARCHIVE does not exist: "
+ "${_TSFILE_ZSTD_ARCHIVE}")
+ endif ()
+else ()
+ file(MAKE_DIRECTORY "${TSFILE_DEPENDENCY_CACHE}")
+ set(_TSFILE_ZSTD_ARCHIVE
+ "${TSFILE_DEPENDENCY_CACHE}/${_TSFILE_ZSTD_ARCHIVE_NAME}")
+endif ()
+
+set(_TSFILE_ZSTD_ARCHIVE_VALID FALSE)
+if (EXISTS "${_TSFILE_ZSTD_ARCHIVE}")
+ file(SHA256 "${_TSFILE_ZSTD_ARCHIVE}" _TSFILE_ZSTD_ACTUAL_SHA256)
+ if (_TSFILE_ZSTD_ACTUAL_SHA256 STREQUAL _TSFILE_ZSTD_SHA256)
+ set(_TSFILE_ZSTD_ARCHIVE_VALID TRUE)
+ elseif (TSFILE_ZSTD_ARCHIVE OR TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Zstandard source archive has an unexpected SHA-256: "
+ "${_TSFILE_ZSTD_ARCHIVE}\n"
+ "Expected: ${_TSFILE_ZSTD_SHA256}\n"
+ "Actual: ${_TSFILE_ZSTD_ACTUAL_SHA256}")
+ else ()
+ message(STATUS
+ "Removing invalid cached Zstandard archive: "
+ "${_TSFILE_ZSTD_ARCHIVE}")
+ file(REMOVE "${_TSFILE_ZSTD_ARCHIVE}")
+ endif ()
+endif ()
+
+if (NOT _TSFILE_ZSTD_ARCHIVE_VALID)
+ if (TSFILE_DEPENDENCY_OFFLINE)
+ message(FATAL_ERROR
+ "Offline dependency mode requires the verified Zstandard "
+ "archive at ${_TSFILE_ZSTD_ARCHIVE}. Pre-download "
+ "${_TSFILE_ZSTD_URL} or set TSFILE_ZSTD_ARCHIVE to a "
+ "verified local archive.")
+ endif ()
+
+ set(_TSFILE_ZSTD_PARTIAL_ARCHIVE "${_TSFILE_ZSTD_ARCHIVE}.part")
+ file(REMOVE "${_TSFILE_ZSTD_PARTIAL_ARCHIVE}")
+ message(STATUS
+ "Downloading Zstandard v${TSFILE_ZSTD_BUNDLED_VERSION}")
+ file(DOWNLOAD
+ "${_TSFILE_ZSTD_URL}"
+ "${_TSFILE_ZSTD_PARTIAL_ARCHIVE}"
+ STATUS _TSFILE_ZSTD_DOWNLOAD_STATUS
+ TLS_VERIFY ON
+ TIMEOUT 120
+ INACTIVITY_TIMEOUT 30)
+ list(GET _TSFILE_ZSTD_DOWNLOAD_STATUS 0
+ _TSFILE_ZSTD_DOWNLOAD_RESULT)
+ list(GET _TSFILE_ZSTD_DOWNLOAD_STATUS 1
+ _TSFILE_ZSTD_DOWNLOAD_MESSAGE)
+ if (NOT _TSFILE_ZSTD_DOWNLOAD_RESULT EQUAL 0)
+ file(REMOVE "${_TSFILE_ZSTD_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Failed to download Zstandard from ${_TSFILE_ZSTD_URL}: "
+ "${_TSFILE_ZSTD_DOWNLOAD_MESSAGE}. To build without "
+ "network access, provide ${_TSFILE_ZSTD_ARCHIVE_NAME} in "
+ "TSFILE_DEPENDENCY_CACHE or set TSFILE_ZSTD_ARCHIVE.")
+ endif ()
+
+ file(SHA256 "${_TSFILE_ZSTD_PARTIAL_ARCHIVE}"
+ _TSFILE_ZSTD_ACTUAL_SHA256)
+ if (NOT _TSFILE_ZSTD_ACTUAL_SHA256 STREQUAL _TSFILE_ZSTD_SHA256)
+ file(REMOVE "${_TSFILE_ZSTD_PARTIAL_ARCHIVE}")
+ message(FATAL_ERROR
+ "Downloaded Zstandard archive has an unexpected SHA-256. "
+ "Expected ${_TSFILE_ZSTD_SHA256}, got "
+ "${_TSFILE_ZSTD_ACTUAL_SHA256}.")
+ endif ()
+ file(RENAME "${_TSFILE_ZSTD_PARTIAL_ARCHIVE}"
+ "${_TSFILE_ZSTD_ARCHIVE}")
+endif ()
+
+set(_TSFILE_ZSTD_EXTRACT_ROOT "${CMAKE_BINARY_DIR}/_deps")
+set(TSFILE_ZSTD_SOURCE_DIR
+ "${_TSFILE_ZSTD_EXTRACT_ROOT}/zstd-${TSFILE_ZSTD_BUNDLED_VERSION}")
+set(_TSFILE_ZSTD_STAMP
+ "${TSFILE_ZSTD_SOURCE_DIR}/.tsfile-archive-sha256")
+set(_TSFILE_ZSTD_EXTRACTED FALSE)
+if (EXISTS "${_TSFILE_ZSTD_STAMP}" AND
+ EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/build/cmake/CMakeLists.txt" AND
+ EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/lib/common/zstd_common.c" AND
+ EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/lib/zstd.h" AND
+ EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/LICENSE")
+ file(READ "${_TSFILE_ZSTD_STAMP}" _TSFILE_ZSTD_STAMP_SHA256)
+ string(STRIP "${_TSFILE_ZSTD_STAMP_SHA256}"
+ _TSFILE_ZSTD_STAMP_SHA256)
+ if (_TSFILE_ZSTD_STAMP_SHA256 STREQUAL _TSFILE_ZSTD_SHA256)
+ set(_TSFILE_ZSTD_EXTRACTED TRUE)
+ endif ()
+endif ()
+
+if (NOT _TSFILE_ZSTD_EXTRACTED)
+ file(REMOVE_RECURSE "${TSFILE_ZSTD_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_ZSTD_EXTRACT_ROOT}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E tar xzf
+ "${_TSFILE_ZSTD_ARCHIVE}"
+ WORKING_DIRECTORY "${_TSFILE_ZSTD_EXTRACT_ROOT}"
+ RESULT_VARIABLE _TSFILE_ZSTD_EXTRACT_RESULT
+ ERROR_VARIABLE _TSFILE_ZSTD_EXTRACT_ERROR)
+ if (NOT _TSFILE_ZSTD_EXTRACT_RESULT EQUAL 0 OR
+ NOT EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/build/cmake/CMakeLists.txt" OR
+ NOT EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/lib/common/zstd_common.c" OR
+ NOT EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/lib/zstd.h" OR
+ NOT EXISTS "${TSFILE_ZSTD_SOURCE_DIR}/LICENSE")
+ file(REMOVE_RECURSE "${TSFILE_ZSTD_SOURCE_DIR}")
+ message(FATAL_ERROR
+ "Failed to extract the Zstandard source archive: "
+ "${_TSFILE_ZSTD_EXTRACT_ERROR}")
+ endif ()
+ file(WRITE "${_TSFILE_ZSTD_STAMP}" "${_TSFILE_ZSTD_SHA256}\n")
+endif ()
+
+set(TSFILE_ZSTD_LICENSE_FILE "${TSFILE_ZSTD_SOURCE_DIR}/LICENSE")
+message(STATUS
+ "Using verified Zstandard v${TSFILE_ZSTD_BUNDLED_VERSION} source "
+ "from ${_TSFILE_ZSTD_ARCHIVE}")
+
+unset(_TSFILE_ZSTD_ACTUAL_SHA256)
+unset(_TSFILE_ZSTD_ARCHIVE)
+unset(_TSFILE_ZSTD_ARCHIVE_NAME)
+unset(_TSFILE_ZSTD_ARCHIVE_VALID)
+unset(_TSFILE_ZSTD_DOWNLOAD_MESSAGE)
+unset(_TSFILE_ZSTD_DOWNLOAD_RESULT)
+unset(_TSFILE_ZSTD_DOWNLOAD_STATUS)
+unset(_TSFILE_ZSTD_EXTRACT_ERROR)
+unset(_TSFILE_ZSTD_EXTRACT_RESULT)
+unset(_TSFILE_ZSTD_EXTRACT_ROOT)
+unset(_TSFILE_ZSTD_EXTRACTED)
+unset(_TSFILE_ZSTD_PARTIAL_ARCHIVE)
+unset(_TSFILE_ZSTD_SHA256)
+unset(_TSFILE_ZSTD_STAMP)
+unset(_TSFILE_ZSTD_STAMP_SHA256)
+unset(_TSFILE_ZSTD_URL)
diff --git a/cpp/cmake/tests/ANTLR4DependencyTest.cmake b/cpp/cmake/tests/ANTLR4DependencyTest.cmake
new file mode 100644
index 000000000..2fc981712
--- /dev/null
+++ b/cpp/cmake/tests/ANTLR4DependencyTest.cmake
@@ -0,0 +1,167 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/ANTLR4Dependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/antlr4-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+set(_TSFILE_MISSING_ROOT "${_TSFILE_TEST_ROOT}/missing")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_antlr4 ROOT VERSION TARGET_NAME)
+ set(_TSFILE_PACKAGE_DIR "${ROOT}/lib/cmake/antlr4-runtime")
+ set(_TSFILE_UTF8CPP_PACKAGE_DIR "${ROOT}/lib/cmake/utf8cpp")
+ set(_TSFILE_INCLUDE_DIR "${ROOT}/include/antlr4-runtime")
+ file(MAKE_DIRECTORY "${_TSFILE_PACKAGE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_UTF8CPP_PACKAGE_DIR}")
+ file(MAKE_DIRECTORY "${_TSFILE_INCLUDE_DIR}")
+ file(WRITE "${_TSFILE_UTF8CPP_PACKAGE_DIR}/utf8cppConfig.cmake"
+ "add_library(utf8cpp INTERFACE IMPORTED)\n")
+ file(WRITE "${_TSFILE_PACKAGE_DIR}/antlr4-runtime-config.cmake"
+ "set(ANTLR_VERSION \"${VERSION}\")\n"
+ "set(antlr4-runtime_VERSION \"${VERSION}\")\n"
+ "set(ANTLR4_INCLUDE_DIR \"${_TSFILE_INCLUDE_DIR}\")\n"
+ "add_library(${TARGET_NAME} INTERFACE IMPORTED)\n"
+ "set_property(TARGET ${TARGET_NAME} PROPERTY "
+ "INTERFACE_LINK_LIBRARIES utf8cpp)\n")
+endfunction()
+
+function(_tsfile_run_antlr4_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS ROOT)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_ANTLR4_SOURCE=${EXPECTED_SOURCE}"
+ "-DCMAKE_PREFIX_PATH=${ROOT}"
+ -DCMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE
+ -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=FALSE
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "ANTLR4 dependency case ${NAME} failed: ${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "ANTLR4 dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system ANTLR4")
+ message(FATAL_ERROR
+ "ANTLR4 dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_antlr4("${_TSFILE_COMPATIBLE_ROOT}" 4.9.3 antlr4_static)
+_tsfile_write_fake_antlr4("${_TSFILE_TOO_OLD_ROOT}" 4.9.2 antlr4_static)
+_tsfile_write_fake_antlr4("${_TSFILE_INCOMPATIBLE_ROOT}" 5.0.0 antlr4_shared)
+file(MAKE_DIRECTORY "${_TSFILE_MISSING_ROOT}")
+
+_tsfile_run_antlr4_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}")
+_tsfile_run_antlr4_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}")
+_tsfile_run_antlr4_case(auto-missing AUTO BUNDLED TRUE
+ "${_TSFILE_MISSING_ROOT}")
+_tsfile_run_antlr4_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}")
+_tsfile_run_antlr4_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}")
+_tsfile_run_antlr4_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}")
+_tsfile_run_antlr4_case(system-missing SYSTEM "" FALSE
+ "${_TSFILE_MISSING_ROOT}")
+_tsfile_run_antlr4_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}")
+_tsfile_run_antlr4_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}")
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/ANTLR4SourceFailureCase.cmake")
+function(_tsfile_assert_antlr4_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -DTEST_ANTLR4_ARCHIVE=${TEST_ANTLR4_ARCHIVE}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "ANTLR4 source failure case ${TEST_CASE} unexpectedly "
+ "succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "ANTLR4 source failure case ${TEST_CASE} had an unclear "
+ "error: ${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_antlr4_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_antlr4_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
+if (TEST_ANTLR4_ARCHIVE)
+ _tsfile_assert_antlr4_source_failure(
+ UTF8CPP_OFFLINE_MISSING "Offline dependency mode requires.*utf8cpp")
+ _tsfile_assert_antlr4_source_failure(
+ UTF8CPP_INVALID_ARCHIVE "utf8cpp.*unexpected SHA-256")
+
+ # The patched sources are written with CRLF on Windows. Recreate that
+ # representation on every platform and verify that the reviewed patch hash
+ # remains stable after newline normalization.
+ set(_TSFILE_PATCH_TEST_RUNTIME
+ "${_TSFILE_TEST_ROOT}/source-failure-UTF8CPP_OFFLINE_MISSING/_deps/antlr4-4.9.3/runtime/Cpp/runtime")
+ set(_TSFILE_PATCH_TEST_FILE
+ "${_TSFILE_PATCH_TEST_RUNTIME}/src/RuleContext.h")
+ if (NOT EXISTS "${_TSFILE_PATCH_TEST_FILE}")
+ message(FATAL_ERROR
+ "ANTLR4 patched-source fixture was not preserved.")
+ endif ()
+ file(READ "${_TSFILE_PATCH_TEST_FILE}" _TSFILE_PATCH_TEST_CONTENT)
+ string(REPLACE "\r\n" "\n" _TSFILE_PATCH_TEST_CONTENT
+ "${_TSFILE_PATCH_TEST_CONTENT}")
+ string(REPLACE "\n" "\r\n" _TSFILE_PATCH_TEST_CONTENT
+ "${_TSFILE_PATCH_TEST_CONTENT}")
+ file(WRITE "${_TSFILE_PATCH_TEST_FILE}"
+ "${_TSFILE_PATCH_TEST_CONTENT}")
+ set(TSFILE_ANTLR4_RUNTIME_DIR "${_TSFILE_PATCH_TEST_RUNTIME}")
+ set(TSFILE_ANTLR4_PATCH_VERIFY_ONLY TRUE)
+ include("${CMAKE_CURRENT_LIST_DIR}/../ANTLR4Patch.cmake")
+ unset(TSFILE_ANTLR4_PATCH_VERIFY_ONLY)
+ unset(TSFILE_ANTLR4_RUNTIME_DIR)
+endif ()
diff --git a/cpp/cmake/tests/ANTLR4SourceFailureCase.cmake b/cpp/cmake/tests/ANTLR4SourceFailureCase.cmake
new file mode 100644
index 000000000..94f2fa43e
--- /dev/null
+++ b/cpp/cmake/tests/ANTLR4SourceFailureCase.cmake
@@ -0,0 +1,56 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_ANTLR4_BUNDLED_VERSION "4.9.3")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+set(CMAKE_BINARY_DIR "${TEST_BINARY_ROOT}/source-failure-${TEST_CASE}")
+file(REMOVE_RECURSE "${CMAKE_BINARY_DIR}")
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_ANTLR4_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+elseif (TEST_CASE MATCHES "^UTF8CPP_")
+ if (NOT TEST_ANTLR4_ARCHIVE)
+ message(FATAL_ERROR
+ "TEST_ANTLR4_ARCHIVE is required for ${TEST_CASE}.")
+ endif ()
+ set(TSFILE_DEPENDENCY_CACHE
+ "${TEST_BINARY_ROOT}/utf8cpp-failure-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+ set(TSFILE_ANTLR4_ARCHIVE "${TEST_ANTLR4_ARCHIVE}"
+ CACHE FILEPATH "" FORCE)
+ if (TEST_CASE STREQUAL "UTF8CPP_INVALID_ARCHIVE")
+ set(TSFILE_UTF8CPP_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+ endif ()
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/ANTLR4Source.cmake")
diff --git a/cpp/cmake/tests/DependencySourceFailureCase.cmake b/cpp/cmake/tests/DependencySourceFailureCase.cmake
new file mode 100644
index 000000000..d876376e3
--- /dev/null
+++ b/cpp/cmake/tests/DependencySourceFailureCase.cmake
@@ -0,0 +1,32 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+
+if (TEST_CASE STREQUAL "INVALID_SOURCE")
+ set(TSFILE_DEPENDENCY_SOURCE "invalid" CACHE STRING "" FORCE)
+ include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+elseif (TEST_CASE STREQUAL "SYSTEM_MISSING")
+ set(TSFILE_DEPENDENCY_SOURCE "SYSTEM" CACHE STRING "" FORCE)
+ include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+ tsfile_resolve_dependency_source("Example" FALSE _TSFILE_RESULT)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
diff --git a/cpp/cmake/tests/DependencySourceTest.cmake b/cpp/cmake/tests/DependencySourceTest.cmake
new file mode 100644
index 000000000..f8dd5b53d
--- /dev/null
+++ b/cpp/cmake/tests/DependencySourceTest.cmake
@@ -0,0 +1,85 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_DEPENDENCY_SOURCE "auto" CACHE STRING "" FORCE)
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+
+function(_tsfile_assert_resolution POLICY SYSTEM_FOUND EXPECTED)
+ set(TSFILE_DEPENDENCY_SOURCE "${POLICY}")
+ tsfile_resolve_dependency_source(
+ "Example" "${SYSTEM_FOUND}" _TSFILE_ACTUAL)
+ if (NOT _TSFILE_ACTUAL STREQUAL "${EXPECTED}")
+ message(FATAL_ERROR
+ "${POLICY} with SYSTEM_FOUND=${SYSTEM_FOUND} resolved to "
+ "${_TSFILE_ACTUAL}; expected ${EXPECTED}.")
+ endif ()
+endfunction()
+
+if (NOT TSFILE_DEPENDENCY_SOURCE STREQUAL "AUTO")
+ message(FATAL_ERROR
+ "Dependency source was not normalized to AUTO: "
+ "${TSFILE_DEPENDENCY_SOURCE}")
+endif ()
+
+_tsfile_assert_resolution(AUTO TRUE SYSTEM)
+_tsfile_assert_resolution(AUTO FALSE BUNDLED)
+_tsfile_assert_resolution(SYSTEM TRUE SYSTEM)
+_tsfile_assert_resolution(BUNDLED TRUE BUNDLED)
+_tsfile_assert_resolution(BUNDLED FALSE BUNDLED)
+
+set(_TSFILE_FAILURE_CASE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/DependencySourceFailureCase.cmake")
+
+execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=INVALID_SOURCE
+ -P "${_TSFILE_FAILURE_CASE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_INVALID_RESULT
+ OUTPUT_VARIABLE _TSFILE_INVALID_OUTPUT
+ ERROR_VARIABLE _TSFILE_INVALID_ERROR)
+if (_TSFILE_INVALID_RESULT EQUAL 0)
+ message(FATAL_ERROR "An invalid dependency source was accepted.")
+endif ()
+set(_TSFILE_INVALID_LOG
+ "${_TSFILE_INVALID_OUTPUT}${_TSFILE_INVALID_ERROR}")
+if (NOT _TSFILE_INVALID_LOG MATCHES "Expected one of")
+ message(FATAL_ERROR
+ "Invalid-source error was unclear: ${_TSFILE_INVALID_LOG}")
+endif ()
+
+execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=SYSTEM_MISSING
+ -P "${_TSFILE_FAILURE_CASE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_SYSTEM_RESULT
+ OUTPUT_VARIABLE _TSFILE_SYSTEM_OUTPUT
+ ERROR_VARIABLE _TSFILE_SYSTEM_ERROR)
+if (_TSFILE_SYSTEM_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "SYSTEM mode accepted a missing required dependency.")
+endif ()
+set(_TSFILE_SYSTEM_LOG
+ "${_TSFILE_SYSTEM_OUTPUT}${_TSFILE_SYSTEM_ERROR}")
+if (NOT _TSFILE_SYSTEM_LOG MATCHES "requires a compatible")
+ message(FATAL_ERROR
+ "Missing-system-dependency error was unclear: "
+ "${_TSFILE_SYSTEM_LOG}")
+endif ()
diff --git a/cpp/cmake/tests/LZ4DependencyTest.cmake b/cpp/cmake/tests/LZ4DependencyTest.cmake
new file mode 100644
index 000000000..47c012b8c
--- /dev/null
+++ b/cpp/cmake/tests/LZ4DependencyTest.cmake
@@ -0,0 +1,132 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/LZ4Dependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/lz4-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_lz4 ROOT MAJOR MINOR RELEASE)
+ file(MAKE_DIRECTORY "${ROOT}/include" "${ROOT}/lib")
+ file(WRITE "${ROOT}/include/lz4.h"
+ "#define LZ4_VERSION_MAJOR ${MAJOR}\n"
+ "#define LZ4_VERSION_MINOR ${MINOR}\n"
+ "#define LZ4_VERSION_RELEASE ${RELEASE}\n")
+ foreach (_TSFILE_LIBRARY_NAME
+ liblz4.a liblz4.so liblz4.dylib lz4.lib liblz4.lib)
+ file(WRITE "${ROOT}/lib/${_TSFILE_LIBRARY_NAME}" "")
+ endforeach ()
+endfunction()
+
+function(_tsfile_run_lz4_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ set(_TSFILE_CMAKE_ARGUMENTS
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_LZ4_SOURCE=${EXPECTED_SOURCE}")
+ if (ARGC GREATER 4 AND NOT "${ARGV4}" STREQUAL "")
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS "-DLZ4_ROOT=${ARGV4}")
+ endif ()
+ if (ARGC GREATER 5 AND ARGV5)
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-DCMAKE_DISABLE_FIND_PACKAGE_LZ4=TRUE")
+ endif ()
+
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ ${_TSFILE_CMAKE_ARGUMENTS}
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "LZ4 dependency case ${NAME} failed: ${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "LZ4 dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system LZ4 package")
+ message(FATAL_ERROR
+ "LZ4 dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_lz4("${_TSFILE_COMPATIBLE_ROOT}" 1 9 4)
+_tsfile_write_fake_lz4("${_TSFILE_TOO_OLD_ROOT}" 1 9 3)
+_tsfile_write_fake_lz4("${_TSFILE_INCOMPATIBLE_ROOT}" 2 0 0)
+
+_tsfile_run_lz4_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lz4_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lz4_case(auto-missing AUTO BUNDLED TRUE "" TRUE)
+_tsfile_run_lz4_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_lz4_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lz4_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lz4_case(system-missing SYSTEM "" FALSE "" TRUE)
+_tsfile_run_lz4_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_lz4_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/LZ4SourceFailureCase.cmake")
+function(_tsfile_assert_lz4_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "LZ4 source failure case ${TEST_CASE} unexpectedly succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "LZ4 source failure case ${TEST_CASE} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_lz4_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_lz4_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
diff --git a/cpp/cmake/tests/LZ4SourceFailureCase.cmake b/cpp/cmake/tests/LZ4SourceFailureCase.cmake
new file mode 100644
index 000000000..b0fbc4554
--- /dev/null
+++ b/cpp/cmake/tests/LZ4SourceFailureCase.cmake
@@ -0,0 +1,40 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_LZ4_MIN_VERSION "1.9.4")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_LZ4_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/LZ4Source.cmake")
diff --git a/cpp/cmake/tests/LZOKAYDependencyTest.cmake b/cpp/cmake/tests/LZOKAYDependencyTest.cmake
new file mode 100644
index 000000000..87d1ef9e1
--- /dev/null
+++ b/cpp/cmake/tests/LZOKAYDependencyTest.cmake
@@ -0,0 +1,146 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/LZOKAYDependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/lzokay-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_lzokay ROOT VERSION)
+ set(_TSFILE_CONFIG_DIR "${ROOT}/lib/cmake/lzokay")
+ file(MAKE_DIRECTORY "${_TSFILE_CONFIG_DIR}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/lzokayConfig.cmake"
+ "set(lzokay_VERSION \"${VERSION}\")\n"
+ "if (NOT TARGET lzokay::lzokay)\n"
+ " add_library(lzokay::lzokay INTERFACE IMPORTED)\n"
+ "endif ()\n")
+ string(REGEX MATCH "^[0-9]+" _TSFILE_PACKAGE_MAJOR "${VERSION}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/lzokayConfigVersion.cmake"
+ "set(PACKAGE_VERSION \"${VERSION}\")\n"
+ "if (PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "elseif (NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "
+ "${_TSFILE_PACKAGE_MAJOR})\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "else ()\n"
+ " set(PACKAGE_VERSION_COMPATIBLE TRUE)\n"
+ " if (PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_EXACT TRUE)\n"
+ " endif ()\n"
+ "endif ()\n")
+endfunction()
+
+function(_tsfile_run_lzokay_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ set(_TSFILE_CMAKE_ARGUMENTS
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_LZOKAY_SOURCE=${EXPECTED_SOURCE}")
+ if (ARGC GREATER 4 AND NOT "${ARGV4}" STREQUAL "")
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-Dlzokay_DIR=${ARGV4}/lib/cmake/lzokay")
+ endif ()
+ if (ARGC GREATER 5 AND ARGV5)
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-DCMAKE_DISABLE_FIND_PACKAGE_lzokay=TRUE")
+ endif ()
+
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ ${_TSFILE_CMAKE_ARGUMENTS}
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "lzokay dependency case ${NAME} failed: ${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "lzokay dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system lzokay")
+ message(FATAL_ERROR
+ "lzokay dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_lzokay("${_TSFILE_COMPATIBLE_ROOT}" "0.1")
+_tsfile_write_fake_lzokay("${_TSFILE_TOO_OLD_ROOT}" "0.0")
+_tsfile_write_fake_lzokay("${_TSFILE_INCOMPATIBLE_ROOT}" "1.0")
+
+_tsfile_run_lzokay_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lzokay_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lzokay_case(auto-missing AUTO BUNDLED TRUE "" TRUE)
+_tsfile_run_lzokay_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_lzokay_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lzokay_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_lzokay_case(system-missing SYSTEM "" FALSE "" TRUE)
+_tsfile_run_lzokay_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_lzokay_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/LZOKAYSourceFailureCase.cmake")
+function(_tsfile_assert_lzokay_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "lzokay source failure case ${TEST_CASE} unexpectedly "
+ "succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "lzokay source failure case ${TEST_CASE} had an unclear "
+ "error: ${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_lzokay_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_lzokay_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
diff --git a/cpp/cmake/tests/LZOKAYSourceFailureCase.cmake b/cpp/cmake/tests/LZOKAYSourceFailureCase.cmake
new file mode 100644
index 000000000..2a7d5164e
--- /dev/null
+++ b/cpp/cmake/tests/LZOKAYSourceFailureCase.cmake
@@ -0,0 +1,41 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_LZOKAY_COMMIT
+ "5cb18da508cc4d3ec41bc04dccdeef9c5ffedfb2")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_LZOKAY_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/LZOKAYSource.cmake")
diff --git a/cpp/cmake/tests/LibLZMADependencyTest.cmake b/cpp/cmake/tests/LibLZMADependencyTest.cmake
new file mode 100644
index 000000000..f2aeb45b9
--- /dev/null
+++ b/cpp/cmake/tests/LibLZMADependencyTest.cmake
@@ -0,0 +1,150 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/LibLZMADependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/liblzma-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_liblzma ROOT VERSION)
+ set(_TSFILE_CONFIG_DIR "${ROOT}/lib/cmake/liblzma")
+ file(MAKE_DIRECTORY "${_TSFILE_CONFIG_DIR}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/liblzma-config.cmake"
+ "set(liblzma_VERSION \"${VERSION}\")\n"
+ "if (NOT TARGET liblzma::liblzma)\n"
+ " add_library(liblzma::liblzma INTERFACE IMPORTED)\n"
+ "endif ()\n")
+ string(REGEX MATCH "^[0-9]+" _TSFILE_PACKAGE_MAJOR "${VERSION}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/liblzma-config-version.cmake"
+ "set(PACKAGE_VERSION \"${VERSION}\")\n"
+ "if (PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "elseif (NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "
+ "${_TSFILE_PACKAGE_MAJOR})\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "else ()\n"
+ " set(PACKAGE_VERSION_COMPATIBLE TRUE)\n"
+ " if (PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_EXACT TRUE)\n"
+ " endif ()\n"
+ "endif ()\n")
+endfunction()
+
+function(_tsfile_run_liblzma_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ set(_TSFILE_CMAKE_ARGUMENTS
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_LIBLZMA_SOURCE=${EXPECTED_SOURCE}"
+ "-DCMAKE_DISABLE_FIND_PACKAGE_LibLZMA=TRUE")
+ if (ARGC GREATER 4 AND NOT "${ARGV4}" STREQUAL "")
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-Dliblzma_DIR=${ARGV4}/lib/cmake/liblzma"
+ "-DCMAKE_FIND_ROOT_PATH=${ARGV4}"
+ "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY")
+ endif ()
+ if (ARGC GREATER 5 AND ARGV5)
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-DCMAKE_DISABLE_FIND_PACKAGE_liblzma=TRUE")
+ endif ()
+
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ ${_TSFILE_CMAKE_ARGUMENTS}
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "liblzma dependency case ${NAME} failed: "
+ "${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "liblzma dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system liblzma")
+ message(FATAL_ERROR
+ "liblzma dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_liblzma("${_TSFILE_COMPATIBLE_ROOT}" "5.8.3")
+_tsfile_write_fake_liblzma("${_TSFILE_TOO_OLD_ROOT}" "5.8.2")
+_tsfile_write_fake_liblzma("${_TSFILE_INCOMPATIBLE_ROOT}" "6.0.0")
+
+_tsfile_run_liblzma_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_liblzma_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_liblzma_case(auto-missing AUTO BUNDLED TRUE "" TRUE)
+_tsfile_run_liblzma_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_liblzma_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_liblzma_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_liblzma_case(system-missing SYSTEM "" FALSE "" TRUE)
+_tsfile_run_liblzma_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_liblzma_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/LibLZMASourceFailureCase.cmake")
+function(_tsfile_assert_liblzma_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "liblzma source failure case ${TEST_CASE} unexpectedly "
+ "succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "liblzma source failure case ${TEST_CASE} had an unclear "
+ "error: ${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_liblzma_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_liblzma_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
diff --git a/cpp/cmake/tests/LibLZMASourceFailureCase.cmake b/cpp/cmake/tests/LibLZMASourceFailureCase.cmake
new file mode 100644
index 000000000..ab93cbf49
--- /dev/null
+++ b/cpp/cmake/tests/LibLZMASourceFailureCase.cmake
@@ -0,0 +1,40 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_LIBLZMA_BUNDLED_VERSION "5.8.3")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_LIBLZMA_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/LibLZMASource.cmake")
diff --git a/cpp/cmake/tests/SIMDeDependencyTest.cmake b/cpp/cmake/tests/SIMDeDependencyTest.cmake
new file mode 100644
index 000000000..e1d785a6a
--- /dev/null
+++ b/cpp/cmake/tests/SIMDeDependencyTest.cmake
@@ -0,0 +1,129 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/SIMDeDependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/simde-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+set(_TSFILE_MISSING_ROOT "${_TSFILE_TEST_ROOT}/missing")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_simde ROOT MAJOR MINOR MICRO)
+ set(_TSFILE_INCLUDE_DIR "${ROOT}/include/simde")
+ file(MAKE_DIRECTORY "${_TSFILE_INCLUDE_DIR}/x86")
+ file(WRITE "${_TSFILE_INCLUDE_DIR}/simde-common.h"
+ "#define SIMDE_VERSION_MAJOR ${MAJOR}\n"
+ "#define SIMDE_VERSION_MINOR ${MINOR}\n"
+ "#define SIMDE_VERSION_MICRO ${MICRO}\n")
+ file(WRITE "${_TSFILE_INCLUDE_DIR}/x86/ssse3.h" "\n")
+endfunction()
+
+function(_tsfile_run_simde_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS ROOT)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_SIMDE_SOURCE=${EXPECTED_SOURCE}"
+ "-DCMAKE_DISABLE_FIND_PACKAGE_simde=TRUE"
+ "-DSIMDE_ROOT=${ROOT}"
+ "-DCMAKE_FIND_ROOT_PATH=${ROOT}"
+ "-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY"
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "SIMDe dependency case ${NAME} failed: ${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "SIMDe dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system SIMDe")
+ message(FATAL_ERROR
+ "SIMDe dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_simde("${_TSFILE_COMPATIBLE_ROOT}" 0 8 4)
+_tsfile_write_fake_simde("${_TSFILE_TOO_OLD_ROOT}" 0 8 3)
+_tsfile_write_fake_simde("${_TSFILE_INCOMPATIBLE_ROOT}" 1 0 0)
+file(MAKE_DIRECTORY "${_TSFILE_MISSING_ROOT}")
+
+_tsfile_run_simde_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}")
+_tsfile_run_simde_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}")
+_tsfile_run_simde_case(auto-missing AUTO BUNDLED TRUE
+ "${_TSFILE_MISSING_ROOT}")
+_tsfile_run_simde_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}")
+_tsfile_run_simde_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}")
+_tsfile_run_simde_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}")
+_tsfile_run_simde_case(system-missing SYSTEM "" FALSE
+ "${_TSFILE_MISSING_ROOT}")
+_tsfile_run_simde_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}")
+_tsfile_run_simde_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}")
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/SIMDeSourceFailureCase.cmake")
+function(_tsfile_assert_simde_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "SIMDe source failure case ${TEST_CASE} unexpectedly "
+ "succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "SIMDe source failure case ${TEST_CASE} had an unclear "
+ "error: ${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_simde_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_simde_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
diff --git a/cpp/cmake/tests/SIMDeSourceFailureCase.cmake b/cpp/cmake/tests/SIMDeSourceFailureCase.cmake
new file mode 100644
index 000000000..48100b289
--- /dev/null
+++ b/cpp/cmake/tests/SIMDeSourceFailureCase.cmake
@@ -0,0 +1,40 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_SIMDE_BUNDLED_VERSION "0.8.4-rc3")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_SIMDE_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/SIMDeSource.cmake")
diff --git a/cpp/cmake/tests/SnappyDependencyTest.cmake b/cpp/cmake/tests/SnappyDependencyTest.cmake
new file mode 100644
index 000000000..26ec5dd2d
--- /dev/null
+++ b/cpp/cmake/tests/SnappyDependencyTest.cmake
@@ -0,0 +1,148 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/SnappyDependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/snappy-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_snappy ROOT VERSION)
+ set(_TSFILE_CONFIG_DIR "${ROOT}/lib/cmake/Snappy")
+ file(MAKE_DIRECTORY "${_TSFILE_CONFIG_DIR}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/SnappyConfig.cmake"
+ "set(Snappy_VERSION \"${VERSION}\")\n"
+ "if (NOT TARGET Snappy::snappy)\n"
+ " add_library(Snappy::snappy INTERFACE IMPORTED)\n"
+ "endif ()\n")
+ string(REGEX MATCH "^[0-9]+" _TSFILE_PACKAGE_MAJOR "${VERSION}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/SnappyConfigVersion.cmake"
+ "set(PACKAGE_VERSION \"${VERSION}\")\n"
+ "if (PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "elseif (NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "
+ "${_TSFILE_PACKAGE_MAJOR})\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "else ()\n"
+ " set(PACKAGE_VERSION_COMPATIBLE TRUE)\n"
+ " if (PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_EXACT TRUE)\n"
+ " endif ()\n"
+ "endif ()\n")
+endfunction()
+
+function(_tsfile_run_snappy_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ set(_TSFILE_CMAKE_ARGUMENTS
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_SNAPPY_SOURCE=${EXPECTED_SOURCE}")
+ if (ARGC GREATER 4 AND NOT "${ARGV4}" STREQUAL "")
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-DSnappy_DIR=${ARGV4}/lib/cmake/Snappy"
+ "-DCMAKE_FIND_ROOT_PATH=${ARGV4}"
+ "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY")
+ endif ()
+ if (ARGC GREATER 5 AND ARGV5)
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-DCMAKE_DISABLE_FIND_PACKAGE_Snappy=TRUE")
+ endif ()
+
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ ${_TSFILE_CMAKE_ARGUMENTS}
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "Snappy dependency case ${NAME} failed: ${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "Snappy dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system Snappy")
+ message(FATAL_ERROR
+ "Snappy dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_snappy("${_TSFILE_COMPATIBLE_ROOT}" "1.2.1")
+_tsfile_write_fake_snappy("${_TSFILE_TOO_OLD_ROOT}" "1.2.0")
+_tsfile_write_fake_snappy("${_TSFILE_INCOMPATIBLE_ROOT}" "2.0.0")
+
+_tsfile_run_snappy_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_snappy_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_snappy_case(auto-missing AUTO BUNDLED TRUE "" TRUE)
+_tsfile_run_snappy_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_snappy_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_snappy_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_snappy_case(system-missing SYSTEM "" FALSE "" TRUE)
+_tsfile_run_snappy_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_snappy_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/SnappySourceFailureCase.cmake")
+function(_tsfile_assert_snappy_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "Snappy source failure case ${TEST_CASE} unexpectedly "
+ "succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "Snappy source failure case ${TEST_CASE} had an unclear "
+ "error: ${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_snappy_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_snappy_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
diff --git a/cpp/cmake/tests/SnappySourceFailureCase.cmake b/cpp/cmake/tests/SnappySourceFailureCase.cmake
new file mode 100644
index 000000000..821a9002a
--- /dev/null
+++ b/cpp/cmake/tests/SnappySourceFailureCase.cmake
@@ -0,0 +1,40 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_SNAPPY_BUNDLED_VERSION "1.2.2")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_SNAPPY_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/SnappySource.cmake")
diff --git a/cpp/cmake/tests/TestGeneratorArguments.cmake b/cpp/cmake/tests/TestGeneratorArguments.cmake
new file mode 100644
index 000000000..cea9db8f1
--- /dev/null
+++ b/cpp/cmake/tests/TestGeneratorArguments.cmake
@@ -0,0 +1,32 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+set(_TSFILE_TEST_GENERATOR_ARGUMENTS "")
+if (TEST_CMAKE_GENERATOR)
+ list(APPEND _TSFILE_TEST_GENERATOR_ARGUMENTS
+ -G "${TEST_CMAKE_GENERATOR}")
+endif ()
+if (TEST_CMAKE_GENERATOR_PLATFORM)
+ list(APPEND _TSFILE_TEST_GENERATOR_ARGUMENTS
+ -A "${TEST_CMAKE_GENERATOR_PLATFORM}")
+endif ()
+if (TEST_CMAKE_GENERATOR_TOOLSET)
+ list(APPEND _TSFILE_TEST_GENERATOR_ARGUMENTS
+ -T "${TEST_CMAKE_GENERATOR_TOOLSET}")
+endif ()
diff --git a/cpp/cmake/tests/ZLIBDependencyTest.cmake b/cpp/cmake/tests/ZLIBDependencyTest.cmake
new file mode 100644
index 000000000..a2a80ef29
--- /dev/null
+++ b/cpp/cmake/tests/ZLIBDependencyTest.cmake
@@ -0,0 +1,130 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/ZLIBDependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/zlib-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_zlib ROOT VERSION)
+ file(MAKE_DIRECTORY "${ROOT}/include" "${ROOT}/lib")
+ file(WRITE "${ROOT}/include/zlib.h"
+ "#define ZLIB_VERSION \"${VERSION}\"\n")
+ foreach (_TSFILE_LIBRARY_NAME
+ libz.a libz.so libz.dylib z.lib zlib.lib zlibstatic.lib)
+ file(WRITE "${ROOT}/lib/${_TSFILE_LIBRARY_NAME}" "")
+ endforeach ()
+endfunction()
+
+function(_tsfile_run_zlib_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ set(_TSFILE_CMAKE_ARGUMENTS
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_ZLIB_SOURCE=${EXPECTED_SOURCE}")
+ if (ARGC GREATER 4 AND NOT "${ARGV4}" STREQUAL "")
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS "-DZLIB_ROOT=${ARGV4}")
+ endif ()
+ if (ARGC GREATER 5 AND ARGV5)
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE")
+ endif ()
+
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ ${_TSFILE_CMAKE_ARGUMENTS}
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "zlib dependency case ${NAME} failed: ${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "zlib dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system zlib package")
+ message(FATAL_ERROR
+ "zlib dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_zlib("${_TSFILE_COMPATIBLE_ROOT}" "1.3.1")
+_tsfile_write_fake_zlib("${_TSFILE_TOO_OLD_ROOT}" "1.3.0")
+_tsfile_write_fake_zlib("${_TSFILE_INCOMPATIBLE_ROOT}" "2.0.0")
+
+_tsfile_run_zlib_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zlib_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zlib_case(auto-missing AUTO BUNDLED TRUE "" TRUE)
+_tsfile_run_zlib_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_zlib_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zlib_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zlib_case(system-missing SYSTEM "" FALSE "" TRUE)
+_tsfile_run_zlib_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_zlib_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/ZLIBSourceFailureCase.cmake")
+function(_tsfile_assert_zlib_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "zlib source failure case ${TEST_CASE} unexpectedly succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "zlib source failure case ${TEST_CASE} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_zlib_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_zlib_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
diff --git a/cpp/cmake/tests/ZLIBSourceFailureCase.cmake b/cpp/cmake/tests/ZLIBSourceFailureCase.cmake
new file mode 100644
index 000000000..fcae5fa3e
--- /dev/null
+++ b/cpp/cmake/tests/ZLIBSourceFailureCase.cmake
@@ -0,0 +1,41 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_ZLIB_MIN_VERSION "1.3.1")
+set(TSFILE_ZLIB_BUNDLED_VERSION "1.3.1")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_ZLIB_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/ZLIBSource.cmake")
diff --git a/cpp/cmake/tests/ZSTDDependencyTest.cmake b/cpp/cmake/tests/ZSTDDependencyTest.cmake
new file mode 100644
index 000000000..5def3a842
--- /dev/null
+++ b/cpp/cmake/tests/ZSTDDependencyTest.cmake
@@ -0,0 +1,149 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+include("${CMAKE_CURRENT_LIST_DIR}/TestGeneratorArguments.cmake")
+
+set(_TSFILE_FIXTURE_SOURCE
+ "${CMAKE_CURRENT_LIST_DIR}/projects/ZSTDDependency")
+set(_TSFILE_TEST_ROOT "${TEST_BINARY_ROOT}/zstd-dependency")
+set(_TSFILE_COMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/compatible")
+set(_TSFILE_TOO_OLD_ROOT "${_TSFILE_TEST_ROOT}/too-old")
+set(_TSFILE_INCOMPATIBLE_ROOT "${_TSFILE_TEST_ROOT}/incompatible")
+file(REMOVE_RECURSE "${_TSFILE_TEST_ROOT}")
+
+function(_tsfile_write_fake_zstd ROOT VERSION)
+ set(_TSFILE_CONFIG_DIR "${ROOT}/lib/cmake/zstd")
+ file(MAKE_DIRECTORY "${_TSFILE_CONFIG_DIR}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/zstdConfig.cmake"
+ "set(zstd_VERSION \"${VERSION}\")\n"
+ "if (NOT TARGET zstd::libzstd_static)\n"
+ " add_library(zstd::libzstd_static INTERFACE IMPORTED)\n"
+ "endif ()\n")
+ string(REGEX MATCH "^[0-9]+" _TSFILE_PACKAGE_MAJOR "${VERSION}")
+ file(WRITE "${_TSFILE_CONFIG_DIR}/zstdConfigVersion.cmake"
+ "set(PACKAGE_VERSION \"${VERSION}\")\n"
+ "if (PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "elseif (NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "
+ "${_TSFILE_PACKAGE_MAJOR})\n"
+ " set(PACKAGE_VERSION_COMPATIBLE FALSE)\n"
+ "else ()\n"
+ " set(PACKAGE_VERSION_COMPATIBLE TRUE)\n"
+ " if (PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)\n"
+ " set(PACKAGE_VERSION_EXACT TRUE)\n"
+ " endif ()\n"
+ "endif ()\n")
+endfunction()
+
+function(_tsfile_run_zstd_case NAME POLICY EXPECTED_SOURCE EXPECT_SUCCESS)
+ set(_TSFILE_CASE_BINARY "${_TSFILE_TEST_ROOT}/build-${NAME}")
+ set(_TSFILE_CMAKE_ARGUMENTS
+ "-DTSFILE_DEPENDENCY_SOURCE=${POLICY}"
+ "-DEXPECTED_ZSTD_SOURCE=${EXPECTED_SOURCE}")
+ if (ARGC GREATER 4 AND NOT "${ARGV4}" STREQUAL "")
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-Dzstd_DIR=${ARGV4}/lib/cmake/zstd"
+ "-DCMAKE_FIND_ROOT_PATH=${ARGV4}"
+ "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY")
+ endif ()
+ if (ARGC GREATER 5 AND ARGV5)
+ list(APPEND _TSFILE_CMAKE_ARGUMENTS
+ "-DCMAKE_DISABLE_FIND_PACKAGE_zstd=TRUE")
+ endif ()
+
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ ${_TSFILE_TEST_GENERATOR_ARGUMENTS}
+ ${_TSFILE_CMAKE_ARGUMENTS}
+ -S "${_TSFILE_FIXTURE_SOURCE}"
+ -B "${_TSFILE_CASE_BINARY}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+
+ if (EXPECT_SUCCESS)
+ if (NOT _TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "Zstandard dependency case ${NAME} failed: "
+ "${_TSFILE_LOG}")
+ endif ()
+ elseif (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "Zstandard dependency case ${NAME} unexpectedly succeeded.")
+ elseif (NOT _TSFILE_LOG MATCHES
+ "requires a compatible system Zstandard")
+ message(FATAL_ERROR
+ "Zstandard dependency case ${NAME} had an unclear error: "
+ "${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_write_fake_zstd("${_TSFILE_COMPATIBLE_ROOT}" "1.5.7")
+_tsfile_write_fake_zstd("${_TSFILE_TOO_OLD_ROOT}" "1.5.6")
+_tsfile_write_fake_zstd("${_TSFILE_INCOMPATIBLE_ROOT}" "2.0.0")
+
+_tsfile_run_zstd_case(system-compatible SYSTEM SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zstd_case(auto-compatible AUTO SYSTEM TRUE
+ "${_TSFILE_COMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zstd_case(auto-missing AUTO BUNDLED TRUE "" TRUE)
+_tsfile_run_zstd_case(auto-too-old AUTO BUNDLED TRUE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_zstd_case(auto-incompatible AUTO BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zstd_case(bundled BUNDLED BUNDLED TRUE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+_tsfile_run_zstd_case(system-missing SYSTEM "" FALSE "" TRUE)
+_tsfile_run_zstd_case(system-too-old SYSTEM "" FALSE
+ "${_TSFILE_TOO_OLD_ROOT}" FALSE)
+_tsfile_run_zstd_case(system-incompatible SYSTEM "" FALSE
+ "${_TSFILE_INCOMPATIBLE_ROOT}" FALSE)
+
+set(_TSFILE_SOURCE_FAILURE_SCRIPT
+ "${CMAKE_CURRENT_LIST_DIR}/ZSTDSourceFailureCase.cmake")
+function(_tsfile_assert_zstd_source_failure TEST_CASE EXPECTED_ERROR)
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}"
+ -DTEST_CASE=${TEST_CASE}
+ -DTEST_BINARY_ROOT=${_TSFILE_TEST_ROOT}
+ -P "${_TSFILE_SOURCE_FAILURE_SCRIPT}"
+ RESULT_VARIABLE _TSFILE_RESULT
+ OUTPUT_VARIABLE _TSFILE_OUTPUT
+ ERROR_VARIABLE _TSFILE_ERROR)
+ if (_TSFILE_RESULT EQUAL 0)
+ message(FATAL_ERROR
+ "Zstandard source failure case ${TEST_CASE} unexpectedly "
+ "succeeded.")
+ endif ()
+ set(_TSFILE_LOG "${_TSFILE_OUTPUT}${_TSFILE_ERROR}")
+ if (NOT _TSFILE_LOG MATCHES "${EXPECTED_ERROR}")
+ message(FATAL_ERROR
+ "Zstandard source failure case ${TEST_CASE} had an unclear "
+ "error: ${_TSFILE_LOG}")
+ endif ()
+endfunction()
+
+_tsfile_assert_zstd_source_failure(
+ OFFLINE_MISSING "Offline dependency mode requires")
+_tsfile_assert_zstd_source_failure(
+ INVALID_ARCHIVE "unexpected SHA-256")
diff --git a/cpp/cmake/tests/ZSTDSourceFailureCase.cmake b/cpp/cmake/tests/ZSTDSourceFailureCase.cmake
new file mode 100644
index 000000000..e2551b05d
--- /dev/null
+++ b/cpp/cmake/tests/ZSTDSourceFailureCase.cmake
@@ -0,0 +1,40 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+if (NOT TEST_BINARY_ROOT)
+ message(FATAL_ERROR "TEST_BINARY_ROOT must be provided.")
+endif ()
+
+get_filename_component(_TSFILE_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/.."
+ ABSOLUTE)
+set(TSFILE_ZSTD_BUNDLED_VERSION "1.5.7")
+set(TSFILE_DEPENDENCY_OFFLINE ON)
+
+if (TEST_CASE STREQUAL "OFFLINE_MISSING")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/missing-cache")
+ file(REMOVE_RECURSE "${TSFILE_DEPENDENCY_CACHE}")
+elseif (TEST_CASE STREQUAL "INVALID_ARCHIVE")
+ set(TSFILE_DEPENDENCY_CACHE "${TEST_BINARY_ROOT}/invalid-cache")
+ set(TSFILE_ZSTD_ARCHIVE "${CMAKE_CURRENT_LIST_FILE}"
+ CACHE FILEPATH "" FORCE)
+else ()
+ message(FATAL_ERROR "Unknown TEST_CASE='${TEST_CASE}'.")
+endif ()
+
+include("${_TSFILE_CMAKE_DIR}/ZSTDSource.cmake")
diff --git a/cpp/cmake/tests/projects/ANTLR4Dependency/CMakeLists.txt b/cpp/cmake/tests/projects/ANTLR4Dependency/CMakeLists.txt
new file mode 100644
index 000000000..61901e38a
--- /dev/null
+++ b/cpp/cmake/tests/projects/ANTLR4Dependency/CMakeLists.txt
@@ -0,0 +1,50 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileANTLR4DependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+list(APPEND CMAKE_MODULE_PATH "${_TSFILE_CMAKE_DIR}")
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/ANTLR4Dependency.cmake")
+
+if (NOT TSFILE_ANTLR4_SOURCE STREQUAL EXPECTED_ANTLR4_SOURCE)
+ message(FATAL_ERROR
+ "ANTLR4 resolved to ${TSFILE_ANTLR4_SOURCE}; "
+ "expected ${EXPECTED_ANTLR4_SOURCE}.")
+endif ()
+
+if (TSFILE_ANTLR4_SOURCE STREQUAL "SYSTEM" AND
+ "${TSFILE_ANTLR4_SYSTEM_TARGET}" STREQUAL "")
+ message(FATAL_ERROR
+ "System ANTLR4 did not provide a supported runtime target.")
+endif ()
+
+if (TSFILE_ANTLR4_SOURCE STREQUAL "SYSTEM" AND
+ NOT IS_DIRECTORY "${TSFILE_ANTLR4_SYSTEM_INCLUDE_DIR}")
+ message(FATAL_ERROR
+ "System ANTLR4 did not preserve its public include directory.")
+endif ()
+
+if (TSFILE_ANTLR4_SOURCE STREQUAL "SYSTEM" AND NOT TARGET utf8cpp)
+ message(FATAL_ERROR
+ "System ANTLR4 did not resolve its utf8cpp target dependency.")
+endif ()
diff --git a/cpp/cmake/tests/projects/LZ4Dependency/CMakeLists.txt b/cpp/cmake/tests/projects/LZ4Dependency/CMakeLists.txt
new file mode 100644
index 000000000..8fa81c269
--- /dev/null
+++ b/cpp/cmake/tests/projects/LZ4Dependency/CMakeLists.txt
@@ -0,0 +1,37 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileLZ4DependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+list(APPEND CMAKE_MODULE_PATH "${_TSFILE_CMAKE_DIR}")
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/LZ4Dependency.cmake")
+
+if (NOT TSFILE_LZ4_SOURCE STREQUAL EXPECTED_LZ4_SOURCE)
+ message(FATAL_ERROR
+ "LZ4 resolved to ${TSFILE_LZ4_SOURCE}; "
+ "expected ${EXPECTED_LZ4_SOURCE}.")
+endif ()
+
+if (TSFILE_LZ4_SOURCE STREQUAL "SYSTEM" AND NOT TARGET LZ4::LZ4)
+ message(FATAL_ERROR "System LZ4 did not provide the LZ4::LZ4 target.")
+endif ()
diff --git a/cpp/cmake/tests/projects/LZOKAYDependency/CMakeLists.txt b/cpp/cmake/tests/projects/LZOKAYDependency/CMakeLists.txt
new file mode 100644
index 000000000..55d67787e
--- /dev/null
+++ b/cpp/cmake/tests/projects/LZOKAYDependency/CMakeLists.txt
@@ -0,0 +1,38 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileLZOKAYDependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/LZOKAYDependency.cmake")
+
+if (NOT TSFILE_LZOKAY_SOURCE STREQUAL EXPECTED_LZOKAY_SOURCE)
+ message(FATAL_ERROR
+ "lzokay resolved to ${TSFILE_LZOKAY_SOURCE}; "
+ "expected ${EXPECTED_LZOKAY_SOURCE}.")
+endif ()
+
+if (TSFILE_LZOKAY_SOURCE STREQUAL "SYSTEM" AND
+ NOT TARGET lzokay::lzokay)
+ message(FATAL_ERROR
+ "System lzokay did not provide the lzokay::lzokay target.")
+endif ()
diff --git a/cpp/cmake/tests/projects/LibLZMADependency/CMakeLists.txt b/cpp/cmake/tests/projects/LibLZMADependency/CMakeLists.txt
new file mode 100644
index 000000000..268158d1f
--- /dev/null
+++ b/cpp/cmake/tests/projects/LibLZMADependency/CMakeLists.txt
@@ -0,0 +1,38 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileLibLZMADependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+list(APPEND CMAKE_MODULE_PATH "${_TSFILE_CMAKE_DIR}")
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/LibLZMADependency.cmake")
+
+if (NOT TSFILE_LIBLZMA_SOURCE STREQUAL EXPECTED_LIBLZMA_SOURCE)
+ message(FATAL_ERROR
+ "liblzma resolved to ${TSFILE_LIBLZMA_SOURCE}; "
+ "expected ${EXPECTED_LIBLZMA_SOURCE}.")
+endif ()
+
+if (TSFILE_LIBLZMA_SOURCE STREQUAL "SYSTEM" AND
+ "${TSFILE_LIBLZMA_SYSTEM_TARGET}" STREQUAL "")
+ message(FATAL_ERROR "System liblzma did not provide a usable target.")
+endif ()
diff --git a/cpp/cmake/tests/projects/SIMDeDependency/CMakeLists.txt b/cpp/cmake/tests/projects/SIMDeDependency/CMakeLists.txt
new file mode 100644
index 000000000..edde5e0a8
--- /dev/null
+++ b/cpp/cmake/tests/projects/SIMDeDependency/CMakeLists.txt
@@ -0,0 +1,39 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileSIMDeDependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+list(APPEND CMAKE_MODULE_PATH "${_TSFILE_CMAKE_DIR}")
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/SIMDeDependency.cmake")
+
+if (NOT TSFILE_SIMDE_SOURCE STREQUAL EXPECTED_SIMDE_SOURCE)
+ message(FATAL_ERROR
+ "SIMDe resolved to ${TSFILE_SIMDE_SOURCE}; "
+ "expected ${EXPECTED_SIMDE_SOURCE}.")
+endif ()
+
+if (TSFILE_SIMDE_SOURCE STREQUAL "SYSTEM" AND
+ NOT TARGET simde::simde)
+ message(FATAL_ERROR
+ "System SIMDe did not provide the simde::simde target.")
+endif ()
diff --git a/cpp/cmake/tests/projects/SnappyDependency/CMakeLists.txt b/cpp/cmake/tests/projects/SnappyDependency/CMakeLists.txt
new file mode 100644
index 000000000..a105ebe21
--- /dev/null
+++ b/cpp/cmake/tests/projects/SnappyDependency/CMakeLists.txt
@@ -0,0 +1,38 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileSnappyDependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/SnappyDependency.cmake")
+
+if (NOT TSFILE_SNAPPY_SOURCE STREQUAL EXPECTED_SNAPPY_SOURCE)
+ message(FATAL_ERROR
+ "Snappy resolved to ${TSFILE_SNAPPY_SOURCE}; "
+ "expected ${EXPECTED_SNAPPY_SOURCE}.")
+endif ()
+
+if (TSFILE_SNAPPY_SOURCE STREQUAL "SYSTEM" AND
+ NOT TARGET Snappy::snappy)
+ message(FATAL_ERROR
+ "System Snappy did not provide the Snappy::snappy target.")
+endif ()
diff --git a/cpp/cmake/tests/projects/ZLIBDependency/CMakeLists.txt b/cpp/cmake/tests/projects/ZLIBDependency/CMakeLists.txt
new file mode 100644
index 000000000..b481a1914
--- /dev/null
+++ b/cpp/cmake/tests/projects/ZLIBDependency/CMakeLists.txt
@@ -0,0 +1,36 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileZLIBDependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/ZLIBDependency.cmake")
+
+if (NOT TSFILE_ZLIB_SOURCE STREQUAL EXPECTED_ZLIB_SOURCE)
+ message(FATAL_ERROR
+ "zlib resolved to ${TSFILE_ZLIB_SOURCE}; "
+ "expected ${EXPECTED_ZLIB_SOURCE}.")
+endif ()
+
+if (TSFILE_ZLIB_SOURCE STREQUAL "SYSTEM" AND NOT TARGET ZLIB::ZLIB)
+ message(FATAL_ERROR "System zlib did not provide the ZLIB::ZLIB target.")
+endif ()
diff --git a/cpp/cmake/tests/projects/ZSTDDependency/CMakeLists.txt b/cpp/cmake/tests/projects/ZSTDDependency/CMakeLists.txt
new file mode 100644
index 000000000..94f387ec7
--- /dev/null
+++ b/cpp/cmake/tests/projects/ZSTDDependency/CMakeLists.txt
@@ -0,0 +1,38 @@
+#[[
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+]]
+
+cmake_minimum_required(VERSION 3.11)
+project(TsFileZSTDDependencyTest NONE)
+
+get_filename_component(_TSFILE_CMAKE_DIR
+ "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
+list(APPEND CMAKE_MODULE_PATH "${_TSFILE_CMAKE_DIR}")
+include("${_TSFILE_CMAKE_DIR}/DependencySource.cmake")
+include("${_TSFILE_CMAKE_DIR}/ZSTDDependency.cmake")
+
+if (NOT TSFILE_ZSTD_SOURCE STREQUAL EXPECTED_ZSTD_SOURCE)
+ message(FATAL_ERROR
+ "Zstandard resolved to ${TSFILE_ZSTD_SOURCE}; "
+ "expected ${EXPECTED_ZSTD_SOURCE}.")
+endif ()
+
+if (TSFILE_ZSTD_SOURCE STREQUAL "SYSTEM" AND
+ "${TSFILE_ZSTD_SYSTEM_TARGET}" STREQUAL "")
+ message(FATAL_ERROR "System Zstandard did not provide a usable target.")
+endif ()
diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt
index 62bde786a..bf508a2a1 100644
--- a/cpp/examples/CMakeLists.txt
+++ b/cpp/examples/CMakeLists.txt
@@ -35,8 +35,6 @@ message("SDK_LIB_DIR_RELEASE: ${SDK_LIB_DIR_RELEASE}")
set(SDK_LIB_DIR_DEBUG ${PROJECT_SOURCE_DIR}/../build/Debug/lib)
message("SDK_LIB_DIR_DEBUG: ${SDK_LIB_DIR_DEBUG}")
-include_directories(${PROJECT_SOURCE_DIR}/../third_party/antlr4-cpp-runtime-4/runtime/src)
-
set(BUILD_TYPE "Release")
include_directories(${SDK_INCLUDE_DIR})
@@ -54,6 +52,13 @@ endif ()
add_subdirectory(cpp_examples)
add_subdirectory(c_examples)
-add_executable(examples examples.cc)
-target_link_libraries(examples cpp_examples_obj c_examples_obj)
+if (CMAKE_VERSION VERSION_LESS "3.12")
+ add_executable(examples
+ examples.cc
+ $<TARGET_OBJECTS:cpp_examples_obj>
+ $<TARGET_OBJECTS:c_examples_obj>)
+else ()
+ add_executable(examples examples.cc)
+ target_link_libraries(examples cpp_examples_obj c_examples_obj)
+endif ()
target_link_libraries(examples tsfile)
diff --git a/cpp/patches/antlr4-4.9.3-msvc-compat.patch b/cpp/patches/antlr4-4.9.3-msvc-compat.patch
deleted file mode 100644
index f888b8391..000000000
--- a/cpp/patches/antlr4-4.9.3-msvc-compat.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# antlr4-4.9.3-msvc-compat.patch
-#
-# Purpose : Make the bundled ANTLR4 C++ runtime (v4.9.3) compile under MSVC
-# (Visual Studio 2017 / v141) while keeping the project on C++11.
-# Scope : third_party/antlr4-cpp-runtime-4 only. No version change, no
-# generated-parser change, no impact on the Java module (also 4.9.3)
-# or on embedded/C++11 builds.
-# Apply : from the cpp/ directory: git apply patches/antlr4-4.9.3-msvc-compat.patch
-# or: patch -p1 < patches/antlr4-4.9.3-msvc-compat.patch
-#
-# --- Why this is needed -------------------------------------------------------
-#
-# 1) Token.h / LL1Analyzer.h (overload-resolution ambiguity, error C2668)
-# These headers define EPSILON/EOF/HIT_PRED/etc. as either
-# `static constexpr size_t` (when __cplusplus >= 201703L) or as members of an
-# unnamed `enum : size_t` (otherwise). IntervalSet has both contains(size_t)
-# and contains(ssize_t) overloads. Per [conv.prom], converting an unnamed
-# enum with a fixed underlying type to that underlying type is an integral
-# PROMOTION (a strictly better match than a conversion to ssize_t). GCC
-# implements this correctly, so the enum branch compiles there. MSVC 2017
-# does NOT -- it ranks both overloads equally and reports an ambiguous call.
-# MSVC also reports __cplusplus as 199711L by default, so it always took the
-# enum branch. `static constexpr size_t` is fully usable in MSVC 2017's
-# C++11 mode, so we let MSVC take the constexpr branch: the constants become
-# plain size_t values and the ambiguity disappears with no call-site changes.
-# This is ODR-safe: the constants are currently enumerators (which cannot be
-# ODR-used), proving the runtime never takes their address.
-# NOTE: only the headers whose constants reach IntervalSet::contains/remove
-# are patched. The std::string_view guards in ANTLRInputStream.{h,cpp} use
-# the same `#if` and are deliberately left untouched (string_view is C++17).
-#
-# 2) Vocabulary.cpp (error C2039/C2660: isupper)
-# Vocabulary.cpp calls the two-argument std::isupper(charT, const locale&)
-# from <locale> but never includes <locale>; it relied on a transitive
-# include that libstdc++ happens to provide and MSVC's STL does not.
-# Fix: add the missing #include <locale>.
-#
-# ------------------------------------------------------------------------------
---- a/third_party/antlr4-cpp-runtime-4/runtime/src/Token.h
-+++ b/third_party/antlr4-cpp-runtime-4/runtime/src/Token.h
-@@ -14,7 +14,7 @@
- /// we obtained this token.
- class ANTLR4CPP_PUBLIC Token {
- public:
--#if __cplusplus >= 201703L
-+#if __cplusplus >= 201703L || defined(_MSC_VER)
- static constexpr size_t INVALID_TYPE = 0;
- #else
- enum : size_t {
-@@ -24,7 +24,7 @@
-
- /// During lookahead operations, this "token" signifies we hit rule end ATN state
- /// and did not follow it despite needing to.
--#if __cplusplus >= 201703L
-+#if __cplusplus >= 201703L || defined(_MSC_VER)
- static constexpr size_t EPSILON = std::numeric_limits<size_t>::max() - 1;
- static constexpr size_t MIN_USER_TOKEN_TYPE = 1;
- static constexpr size_t EOF = IntStream::EOF;
-@@ -41,7 +41,7 @@
- /// All tokens go to the parser (unless skip() is called in that rule)
- /// on a particular "channel". The parser tunes to a particular channel
- /// so that whitespace etc... can go to the parser on a "hidden" channel.
--#if __cplusplus >= 201703L
-+#if __cplusplus >= 201703L || defined(_MSC_VER)
- static constexpr size_t DEFAULT_CHANNEL = 0;
- #else
- enum : size_t {
-@@ -51,7 +51,7 @@
-
- /// Anything on different channel than DEFAULT_CHANNEL is not parsed
- /// by parser.
--#if __cplusplus >= 201703L
-+#if __cplusplus >= 201703L || defined(_MSC_VER)
- static constexpr size_t HIDDEN_CHANNEL = 1;
- #else
- enum : size_t {
-@@ -70,7 +70,7 @@
- *
- * @see Token#getChannel()
- */
--#if __cplusplus >= 201703L
-+#if __cplusplus >= 201703L || defined(_MSC_VER)
- static constexpr size_t MIN_USER_CHANNEL_VALUE = 2;
- #else
- enum : size_t {
---- a/third_party/antlr4-cpp-runtime-4/runtime/src/atn/LL1Analyzer.h
-+++ b/third_party/antlr4-cpp-runtime-4/runtime/src/atn/LL1Analyzer.h
-@@ -17,7 +17,7 @@
- public:
- /// Special value added to the lookahead sets to indicate that we hit
- /// a predicate during analysis if {@code seeThruPreds==false}.
--#if __cplusplus >= 201703L
-+#if __cplusplus >= 201703L || defined(_MSC_VER)
- static constexpr size_t HIT_PRED = Token::INVALID_TYPE;
- #else
- enum : size_t {
---- a/third_party/antlr4-cpp-runtime-4/runtime/src/Vocabulary.cpp
-+++ b/third_party/antlr4-cpp-runtime-4/runtime/src/Vocabulary.cpp
-@@ -3,6 +3,8 @@
- * can be found in the LICENSE.txt file in the project root.
- */
-
-+#include <locale>
-+
- #include "Token.h"
-
- #include "Vocabulary.h"
diff --git a/cpp/pom.xml b/cpp/pom.xml
index e94debff2..c0fbbc2c5 100644
--- a/cpp/pom.xml
+++ b/cpp/pom.xml
@@ -36,10 +36,20 @@
<enable.asan>OFF</enable.asan>
<build.test>ON</build.test>
<tsfile.build.shared>ON</tsfile.build.shared>
+ <tsfile.dependency.source>AUTO</tsfile.dependency.source>
+ <tsfile.dependency.offline>OFF</tsfile.dependency.offline>
+ <tsfile.dependency.cache>${project.build.directory}/dependency-cache</tsfile.dependency.cache>
<enable.snappy>ON</enable.snappy>
<enable.lz4>ON</enable.lz4>
<enable.lzokay>ON</enable.lzokay>
<enable.zlib>ON</enable.zlib>
+ <enable.zstd>ON</enable.zstd>
+ <!--
+ Keep Maven's default build compatible with CMake 3.11-era
+ industrial toolchains. Bundled XZ Utils requires CMake 3.20+;
+ explicitly pass -Denable.lzma2=ON on a compatible build host.
+ -->
+ <enable.lzma2>OFF</enable.lzma2>
<enable.antlr4>ON</enable.antlr4>
<enable.simd>ON</enable.simd>
</properties>
@@ -84,11 +94,16 @@
<option>-DENABLE_ASAN=${enable.asan}</option>
<option>-DBUILD_TEST=${build.test}</option>
<option>-DTSFILE_BUILD_SHARED=${tsfile.build.shared}</option>
+ <option>-DTSFILE_DEPENDENCY_SOURCE=${tsfile.dependency.source}</option>
+ <option>-DTSFILE_DEPENDENCY_OFFLINE=${tsfile.dependency.offline}</option>
+ <option>-DTSFILE_DEPENDENCY_CACHE=${tsfile.dependency.cache}</option>
<option>-DENABLE_ANTLR4=${enable.antlr4}</option>
<option>-DENABLE_SNAPPY=${enable.snappy}</option>
<option>-DENABLE_LZ4=${enable.lz4}</option>
<option>-DENABLE_LZOKAY=${enable.lzokay}</option>
<option>-DENABLE_ZLIB=${enable.zlib}</option>
+ <option>-DENABLE_ZSTD=${enable.zstd}</option>
+ <option>-DENABLE_LZMA2=${enable.lzma2}</option>
<option>-DENABLE_SIMD=${enable.simd}</option>
<!--
The Visual Studio generator additionally
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt
index 41d2cde12..4e34031ed 100644
--- a/cpp/src/CMakeLists.txt
+++ b/cpp/src/CMakeLists.txt
@@ -45,11 +45,7 @@ if (${COV_ENABLED})
add_compile_options(-fprofile-arcs -ftest-coverage)
endif ()
-if (ENABLE_ANTLR4)
- add_definitions(-DANTLR4CPP_STATIC)
- set(ANTLR4_WITH_STATIC_CRT OFF)
- message("ANTLR4 is enabled, adding ANTLR4 definitions")
-else()
+if (NOT ENABLE_ANTLR4)
message("ANTLR4 is disabled")
endif()
@@ -57,48 +53,6 @@ set(PROJECT_INCLUDE_DIR
${CMAKE_SOURCE_DIR}/src
)
-if (ENABLE_SNAPPY)
- list(APPEND PROJECT_INCLUDE_DIR
- ${THIRD_PARTY_INCLUDE}/google_snappy
- ${CMAKE_SOURCE_DIR}/third_party/google_snappy
- )
-endif()
-
-if (ENABLE_LZ4)
- list(APPEND PROJECT_INCLUDE_DIR
- ${CMAKE_SOURCE_DIR}/third_party/lz4
- )
-endif()
-
-if (ENABLE_LZOKAY)
- list(APPEND PROJECT_INCLUDE_DIR
- ${CMAKE_SOURCE_DIR}/third_party/lzokay
- )
-endif()
-
-if (ENABLE_ZLIB)
- list(APPEND PROJECT_INCLUDE_DIR
- # zlib.h ships in the source tree; zconf.h is generated into the
- # build tree by zlib's own CMake, so both directories are needed.
- ${CMAKE_SOURCE_DIR}/third_party/zlib-1.3.1
- ${THIRD_PARTY_INCLUDE}/zlib-1.3.1
- )
-endif()
-
-if (ENABLE_ANTLR4)
- list(APPEND PROJECT_INCLUDE_DIR
- ${CMAKE_SOURCE_DIR}/third_party/antlr4-cpp-runtime-4/runtime/src
- )
- message("Adding ANTLR4 include directory")
-endif()
-
-if (ENABLE_SIMD)
- add_definitions(-DENABLE_SIMD)
- list(APPEND PROJECT_INCLUDE_DIR
- ${CMAKE_SOURCE_DIR}/third_party/simde-0.8.4-rc3
- )
-endif()
-
include_directories(${PROJECT_INCLUDE_DIR})
# Configure TSFILE_API (see utils/util_define.h) for every translation unit
@@ -124,40 +78,37 @@ add_subdirectory(reader)
add_subdirectory(utils)
add_subdirectory(writer)
-set(COMPRESSION_LIBS "")
-
-if (ENABLE_SNAPPY)
- list(APPEND COMPRESSION_LIBS snappy)
-endif()
-
-if (ENABLE_LZ4)
- list(APPEND COMPRESSION_LIBS LZ4)
-endif()
-
-if (ENABLE_LZOKAY)
- list(APPEND COMPRESSION_LIBS lzokay)
-endif()
-
-if (ENABLE_ZLIB)
- list(APPEND COMPRESSION_LIBS zlibstatic)
-endif()
-
-message("Compression libraries: ${COMPRESSION_LIBS}")
-
+set(_TSFILE_OBJECT_TARGETS
+ common_obj
+ compress_obj
+ cwrapper_obj
+ file_obj
+ read_obj
+ write_obj)
if (ENABLE_ANTLR4)
- target_link_libraries(parser_obj antlr4_static)
- message("Linking parser_obj with antlr4_static")
-endif()
+ list(APPEND _TSFILE_OBJECT_TARGETS parser_obj)
+endif ()
-target_link_libraries(compress_obj ${COMPRESSION_LIBS})
-target_link_libraries(common_obj ${COMPRESSION_LIBS})
-target_link_libraries(read_obj ${COMPRESSION_LIBS})
-target_link_libraries(write_obj ${COMPRESSION_LIBS})
+if (CMAKE_VERSION VERSION_LESS "3.12")
+ set(_TSFILE_OBJECT_SOURCES "")
+ foreach (_TSFILE_OBJECT_TARGET IN LISTS _TSFILE_OBJECT_TARGETS)
+ list(APPEND _TSFILE_OBJECT_SOURCES
+ $<TARGET_OBJECTS:${_TSFILE_OBJECT_TARGET}>)
+ endforeach ()
+endif ()
if (TSFILE_BUILD_SHARED)
- add_library(tsfile SHARED)
+ if (CMAKE_VERSION VERSION_LESS "3.12")
+ add_library(tsfile SHARED ${_TSFILE_OBJECT_SOURCES})
+ else ()
+ add_library(tsfile SHARED)
+ endif ()
else()
- add_library(tsfile STATIC)
+ if (CMAKE_VERSION VERSION_LESS "3.12")
+ add_library(tsfile STATIC ${_TSFILE_OBJECT_SOURCES})
+ else ()
+ add_library(tsfile STATIC)
+ endif ()
# Consumers of the CMake target must see TSFILE_API without DLL import
# decoration when linking the static library on MSVC.
target_compile_definitions(tsfile INTERFACE TSFILE_STATIC)
@@ -172,20 +123,22 @@ if (${COV_ENABLED})
else()
set(COV_LINK_LIB -lgcov)
endif()
- if (ENABLE_ANTLR4)
- target_link_libraries(tsfile common_obj compress_obj cwrapper_obj file_obj read_obj write_obj parser_obj ${COV_LINK_LIB})
+ if (CMAKE_VERSION VERSION_LESS "3.12")
+ target_link_libraries(tsfile ${COV_LINK_LIB})
else()
- target_link_libraries(tsfile common_obj compress_obj cwrapper_obj file_obj read_obj write_obj ${COV_LINK_LIB})
+ target_link_libraries(tsfile ${_TSFILE_OBJECT_TARGETS} ${COV_LINK_LIB})
endif()
else()
message("Disable code cov...")
- if (ENABLE_ANTLR4)
- target_link_libraries(tsfile common_obj compress_obj cwrapper_obj file_obj read_obj write_obj parser_obj)
- else()
- target_link_libraries(tsfile common_obj compress_obj cwrapper_obj file_obj read_obj write_obj)
+ if (NOT CMAKE_VERSION VERSION_LESS "3.12")
+ target_link_libraries(tsfile ${_TSFILE_OBJECT_TARGETS})
endif()
endif()
+unset(_TSFILE_OBJECT_SOURCES)
+unset(_TSFILE_OBJECT_TARGET)
+unset(_TSFILE_OBJECT_TARGETS)
+
add_dependencies(tsfile utils_obj encoding_obj)
if (TSFILE_BUILD_SHARED)
diff --git a/cpp/src/common/db_common.h b/cpp/src/common/db_common.h
index d7130cd03..0c2843b45 100644
--- a/cpp/src/common/db_common.h
+++ b/cpp/src/common/db_common.h
@@ -73,7 +73,10 @@ enum TSEncoding : uint8_t {
GORILLA = 8,
ZIGZAG = 9,
FREQ = 10,
+ CHIMP = 11,
SPRINTZ = 12,
+ RLBE = 13,
+ CAMEL = 14,
INVALID_ENCODING = 255
};
@@ -92,12 +95,14 @@ enum CompressionType : uint8_t {
PAA = 5,
PLA = 6,
LZ4 = 7,
+ ZSTD = 8,
+ LZMA2 = 9,
INVALID_COMPRESSION = 255
};
-extern TSFILE_API const char* s_data_type_names[8];
-extern TSFILE_API const char* s_encoding_names[12];
-extern TSFILE_API const char* s_compression_names[8];
+extern TSFILE_API const char* s_data_type_names[12];
+extern TSFILE_API const char* s_encoding_names[15];
+extern TSFILE_API const char* s_compression_names[10];
} // namespace common
#if defined(__GLIBCXX__) && (__GNUC__ < 7)
@@ -154,11 +159,12 @@ FORCE_INLINE bool parse_data_type_name(const std::string& s, TSDataType& out) {
}
FORCE_INLINE const char* get_encoding_name(TSEncoding encoding) {
- ASSERT(encoding >= PLAIN && encoding <= FREQ);
+ ASSERT(encoding >= PLAIN && encoding <= CAMEL);
return s_encoding_names[encoding];
}
FORCE_INLINE const char* get_compression_name(CompressionType type) {
+ ASSERT(type >= UNCOMPRESSED && type <= LZMA2);
return s_compression_names[type];
}
diff --git a/cpp/src/common/global.cc b/cpp/src/common/global.cc
index ac51dd8b2..91b0e99c3 100644
--- a/cpp/src/common/global.cc
+++ b/cpp/src/common/global.cc
@@ -134,15 +134,18 @@ int config_set_max_degree_of_index_node(uint32_t max_degree_of_index_node) {
}
void set_config_value() {}
-const char* s_data_type_names[8] = {"BOOLEAN", "INT32", "INT64", "FLOAT",
- "DOUBLE", "TEXT", "VECTOR", "STRING"};
+const char* s_data_type_names[12] = {"BOOLEAN", "INT32", "INT64", "FLOAT",
+ "DOUBLE", "TEXT", "VECTOR", "UNKNOWN",
+ "TIMESTAMP", "DATE", "BLOB", "STRING"};
-const char* s_encoding_names[12] = {
- "PLAIN", "DICTIONARY", "RLE", "DIFF", "TS_2DIFF", "BITMAP",
- "GORILLA_V1", "REGULAR", "GORILLA", "ZIGZAG", "FREQ", "SPRINTZ"};
+const char* s_encoding_names[15] = {
+ "PLAIN", "DICTIONARY", "RLE", "DIFF", "TS_2DIFF",
+ "BITMAP", "GORILLA_V1", "REGULAR", "GORILLA", "ZIGZAG",
+ "FREQ", "CHIMP", "SPRINTZ", "RLBE", "CAMEL"};
-const char* s_compression_names[8] = {
- "UNCOMPRESSED", "SNAPPY", "GZIP", "LZO", "SDT", "PAA", "PLA", "LZ4",
+const char* s_compression_names[10] = {
+ "UNCOMPRESSED", "SNAPPY", "GZIP", "LZO", "SDT",
+ "PAA", "PLA", "LZ4", "ZSTD", "LZMA2",
};
int init_common() {
diff --git a/cpp/src/common/global.h b/cpp/src/common/global.h
index ae04c6afa..66a95c1a7 100644
--- a/cpp/src/common/global.h
+++ b/cpp/src/common/global.h
@@ -48,9 +48,8 @@ FORCE_INLINE int set_global_time_data_type(uint8_t data_type) {
}
FORCE_INLINE int set_global_time_encoding(uint8_t encoding) {
- ASSERT(encoding >= PLAIN && encoding <= FREQ);
- if (encoding != TS_2DIFF && encoding != PLAIN && encoding != GORILLA &&
- encoding != ZIGZAG && encoding != RLE && encoding != SPRINTZ) {
+ ASSERT(encoding >= PLAIN && encoding <= CAMEL);
+ if (encoding != TS_2DIFF && encoding != PLAIN) {
return E_NOT_SUPPORT;
}
g_config_value_.time_encoding_type_ = static_cast<TSEncoding>(encoding);
@@ -58,9 +57,10 @@ FORCE_INLINE int set_global_time_encoding(uint8_t encoding) {
}
FORCE_INLINE int set_global_time_compression(uint8_t compression) {
- ASSERT(compression >= UNCOMPRESSED && compression <= LZ4);
+ ASSERT(compression >= UNCOMPRESSED && compression <= LZMA2);
if (compression != UNCOMPRESSED && compression != SNAPPY &&
- compression != GZIP && compression != LZO && compression != LZ4) {
+ compression != GZIP && compression != LZO && compression != LZ4 &&
+ compression != ZSTD && compression != LZMA2) {
return E_NOT_SUPPORT;
}
g_config_value_.time_compress_type_ =
@@ -74,7 +74,7 @@ FORCE_INLINE int set_datatype_encoding(uint8_t data_type, uint8_t encoding) {
// Validate input parameters
ASSERT(dtype >= BOOLEAN && dtype <= STRING);
- ASSERT(encoding >= PLAIN && encoding <= SPRINTZ);
+ ASSERT(encoding >= PLAIN && encoding <= CAMEL);
// Check encoding support for each data type
switch (dtype) {
@@ -86,25 +86,35 @@ FORCE_INLINE int set_datatype_encoding(uint8_t data_type, uint8_t encoding) {
case INT32:
case DATE:
case INT64:
+ case TIMESTAMP:
if (encoding_type != PLAIN && encoding_type != TS_2DIFF &&
encoding_type != GORILLA && encoding_type != ZIGZAG &&
- encoding_type != RLE && encoding_type != SPRINTZ) {
+ encoding_type != RLE && encoding_type != SPRINTZ &&
+ encoding_type != CHIMP && encoding_type != RLBE) {
return E_NOT_SUPPORT;
}
- dtype == INT32
+ (dtype == INT32 || dtype == DATE)
? g_config_value_.int32_encoding_type_ = encoding_type
: g_config_value_.int64_encoding_type_ = encoding_type;
break;
case FLOAT:
+ if (encoding_type != PLAIN && encoding_type != TS_2DIFF &&
+ encoding_type != GORILLA && encoding_type != SPRINTZ &&
+ encoding_type != CHIMP && encoding_type != RLBE) {
+ return E_NOT_SUPPORT;
+ }
+ g_config_value_.float_encoding_type_ = encoding_type;
+ break;
+
case DOUBLE:
if (encoding_type != PLAIN && encoding_type != TS_2DIFF &&
- encoding_type != GORILLA && encoding_type != SPRINTZ) {
+ encoding_type != GORILLA && encoding_type != SPRINTZ &&
+ encoding_type != CHIMP && encoding_type != RLBE &&
+ encoding_type != CAMEL) {
return E_NOT_SUPPORT;
}
- dtype == FLOAT
- ? g_config_value_.float_encoding_type_ = encoding_type
- : g_config_value_.double_encoding_type_ = encoding_type;
+ g_config_value_.double_encoding_type_ = encoding_type;
break;
case STRING:
@@ -122,9 +132,10 @@ FORCE_INLINE int set_datatype_encoding(uint8_t data_type, uint8_t encoding) {
}
FORCE_INLINE int set_global_compression(uint8_t compression) {
- ASSERT(compression >= UNCOMPRESSED && compression <= LZ4);
+ ASSERT(compression >= UNCOMPRESSED && compression <= LZMA2);
if (compression != UNCOMPRESSED && compression != SNAPPY &&
- compression != GZIP && compression != LZO && compression != LZ4) {
+ compression != GZIP && compression != LZO && compression != LZ4 &&
+ compression != ZSTD && compression != LZMA2) {
return E_NOT_SUPPORT;
}
g_config_value_.default_compression_type_ =
@@ -161,7 +172,7 @@ FORCE_INLINE uint8_t get_datatype_encoding(uint8_t data_type) {
case TEXT:
return static_cast<uint8_t>(g_config_value_.string_encoding_type_);
case DATE:
- return static_cast<uint8_t>(g_config_value_.int64_encoding_type_);
+ return static_cast<uint8_t>(g_config_value_.int32_encoding_type_);
default:
return static_cast<uint8_t>(
PLAIN); // Return default encoding for unknown types
diff --git a/cpp/src/common/schema.h b/cpp/src/common/schema.h
index 827ae6d83..7094d3db7 100644
--- a/cpp/src/common/schema.h
+++ b/cpp/src/common/schema.h
@@ -210,8 +210,8 @@ class TableSchema {
}
for (const common::ColumnSchema& column_schema : column_schemas) {
column_schemas_.emplace_back(std::make_shared<MeasurementSchema>(
- column_schema.get_column_name(),
- column_schema.get_data_type()));
+ column_schema.get_column_name(), column_schema.get_data_type(),
+ column_schema.get_encoding(), column_schema.get_compression()));
column_categories_.emplace_back(
column_schema.get_column_category());
}
diff --git a/cpp/src/compress/CMakeLists.txt b/cpp/src/compress/CMakeLists.txt
index 6b1d69d81..4b0399854 100644
--- a/cpp/src/compress/CMakeLists.txt
+++ b/cpp/src/compress/CMakeLists.txt
@@ -50,6 +50,16 @@ if(ENABLE_ZLIB)
list(APPEND HEADERS "gzip_compressor.h")
endif()
+if(ENABLE_ZSTD)
+ list(APPEND compress_SRC_LIST "zstd_compressor.cc")
+ list(APPEND HEADERS "zstd_compressor.h")
+endif()
+
+if(ENABLE_LZMA2)
+ list(APPEND compress_SRC_LIST "lzma2_compressor.cc")
+ list(APPEND HEADERS "lzma2_compressor.h")
+endif()
+
# Add common headers (always copied)
file(GLOB COMMON_HEADERS "*.h")
foreach(header IN LISTS HEADERS)
@@ -71,4 +81,4 @@ foreach(h IN LISTS HEADERS)
endif()
endforeach()
# call copy function with absolute/qualified header paths
-copy_to_dir(${ABS_HEADERS} "compress_obj")
\ No newline at end of file
+copy_to_dir(${ABS_HEADERS} "compress_obj")
diff --git a/cpp/src/compress/compressor_factory.h b/cpp/src/compress/compressor_factory.h
index 912b4628e..c9a9c6405 100644
--- a/cpp/src/compress/compressor_factory.h
+++ b/cpp/src/compress/compressor_factory.h
@@ -20,6 +20,7 @@
#ifndef COMPRESS_COMPRESSOR_FACTORY_H
#define COMPRESS_COMPRESSOR_FACTORY_H
+#include "common/db_common.h"
#include "uncompressed_compressor.h"
#ifdef ENABLE_SNAPPY
@@ -38,6 +39,14 @@
#include "lz4_compressor.h"
#endif
+#ifdef ENABLE_ZSTD
+#include "zstd_compressor.h"
+#endif
+
+#ifdef ENABLE_LZMA2
+#include "lzma2_compressor.h"
+#endif
+
namespace storage {
#define ALLOC_AND_RETURN_COMPRESSPR(CompressorClass) \
@@ -87,6 +96,18 @@ class CompressorFactory {
return nullptr;
} else if (type == common::PLA) {
return nullptr;
+ } else if (type == common::ZSTD) {
+#ifdef ENABLE_ZSTD
+ ALLOC_AND_RETURN_COMPRESSPR(ZstdCompressor);
+#else
+ return nullptr;
+#endif
+ } else if (type == common::LZMA2) {
+#ifdef ENABLE_LZMA2
+ ALLOC_AND_RETURN_COMPRESSPR(LZMA2Compressor);
+#else
+ return nullptr;
+#endif
} else {
ASSERT(false);
return nullptr;
@@ -98,4 +119,4 @@ class CompressorFactory {
} // end namespace storage
-#endif // COMPRESS_COMPRESSOR_FACTORY_H
\ No newline at end of file
+#endif // COMPRESS_COMPRESSOR_FACTORY_H
diff --git a/cpp/src/compress/lzma2_compressor.cc b/cpp/src/compress/lzma2_compressor.cc
new file mode 100644
index 000000000..3c30364ff
--- /dev/null
+++ b/cpp/src/compress/lzma2_compressor.cc
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "lzma2_compressor.h"
+
+#include <limits>
+
+#include "common/allocator/alloc_base.h"
+#include "common/allocator/byte_stream.h"
+
+using namespace common;
+
+namespace storage {
+
+namespace {
+const uint32_t LZMA2_BUFFER_SIZE = 4096;
+}
+
+int LZMA2Compressor::reset(bool /* for_compress */) { return E_OK; }
+
+void LZMA2Compressor::destroy() {
+ if (compressed_buf_ != nullptr) {
+ mem_free(compressed_buf_);
+ compressed_buf_ = nullptr;
+ }
+ if (uncompressed_buf_ != nullptr) {
+ mem_free(uncompressed_buf_);
+ uncompressed_buf_ = nullptr;
+ }
+}
+
+int LZMA2Compressor::compress(char* uncompressed_buf,
+ uint32_t uncompressed_buf_len,
+ char*& compressed_buf,
+ uint32_t& compressed_buf_len) {
+ const size_t max_dst_size = lzma_stream_buffer_bound(uncompressed_buf_len);
+ if (max_dst_size == 0 ||
+ max_dst_size > std::numeric_limits<uint32_t>::max()) {
+ return E_COMPRESS_ERR;
+ }
+
+ compressed_buf_ =
+ static_cast<char*>(mem_alloc(max_dst_size, MOD_COMPRESSOR_OBJ));
+ if (compressed_buf_ == nullptr) {
+ return E_OOM;
+ }
+
+ size_t out_pos = 0;
+ const lzma_ret ret = lzma_easy_buffer_encode(
+ LZMA_PRESET_DEFAULT, LZMA_CHECK_CRC64, nullptr,
+ reinterpret_cast<const uint8_t*>(uncompressed_buf),
+ uncompressed_buf_len, reinterpret_cast<uint8_t*>(compressed_buf_),
+ &out_pos, max_dst_size);
+ if (ret != LZMA_OK) {
+ mem_free(compressed_buf_);
+ compressed_buf_ = nullptr;
+ return E_COMPRESS_ERR;
+ }
+
+ char* compressed_data =
+ static_cast<char*>(mem_realloc(compressed_buf_, out_pos));
+ if (compressed_data == nullptr) {
+ mem_free(compressed_buf_);
+ compressed_buf_ = nullptr;
+ return E_OOM;
+ }
+
+ compressed_buf_ = compressed_data;
+ compressed_buf = compressed_data;
+ compressed_buf_len = static_cast<uint32_t>(out_pos);
+ return E_OK;
+}
+
+void LZMA2Compressor::after_compress(char* compressed_buf) {
+ if (compressed_buf != nullptr) {
+ mem_free(compressed_buf);
+ if (compressed_buf_ == compressed_buf) {
+ compressed_buf_ = nullptr;
+ }
+ }
+}
+
+int LZMA2Compressor::uncompress(char* compressed_buf,
+ uint32_t compressed_buf_len,
+ char*& uncompressed_buf,
+ uint32_t& uncompressed_buf_len) {
+ lzma_stream stream = LZMA_STREAM_INIT;
+ lzma_ret ret = lzma_stream_decoder(&stream, UINT64_MAX, 0);
+ if (ret != LZMA_OK) {
+ return E_COMPRESS_ERR;
+ }
+
+ ByteStream out(LZMA2_BUFFER_SIZE, MOD_COMPRESSOR_OBJ);
+ uint8_t out_buf[LZMA2_BUFFER_SIZE];
+ stream.next_in = reinterpret_cast<const uint8_t*>(compressed_buf);
+ stream.avail_in = compressed_buf_len;
+
+ do {
+ stream.next_out = out_buf;
+ stream.avail_out = LZMA2_BUFFER_SIZE;
+
+ ret = lzma_code(&stream, LZMA_FINISH);
+ if (ret != LZMA_OK && ret != LZMA_STREAM_END) {
+ lzma_end(&stream);
+ out.destroy();
+ return E_COMPRESS_ERR;
+ }
+
+ const uint32_t produced =
+ static_cast<uint32_t>(LZMA2_BUFFER_SIZE - stream.avail_out);
+ if (produced > 0 && out.write_buf(out_buf, produced) != E_OK) {
+ lzma_end(&stream);
+ out.destroy();
+ return E_COMPRESS_ERR;
+ }
+ } while (ret != LZMA_STREAM_END);
+
+ const size_t remaining_input = stream.avail_in;
+ lzma_end(&stream);
+
+ if (remaining_input != 0 ||
+ out.total_size() > std::numeric_limits<uint32_t>::max()) {
+ out.destroy();
+ return E_COMPRESS_ERR;
+ }
+
+ uncompressed_buf_ = get_bytes_from_bytestream(out);
+ uncompressed_buf_len = static_cast<uint32_t>(out.total_size());
+ out.destroy();
+ if (uncompressed_buf_len != 0 && uncompressed_buf_ == nullptr) {
+ return E_OOM;
+ }
+
+ uncompressed_buf = uncompressed_buf_;
+ return E_OK;
+}
+
+void LZMA2Compressor::after_uncompress(char* uncompressed_buf) {
+ if (uncompressed_buf != nullptr) {
+ mem_free(uncompressed_buf);
+ if (uncompressed_buf_ == uncompressed_buf) {
+ uncompressed_buf_ = nullptr;
+ }
+ }
+}
+
+} // namespace storage
diff --git a/cpp/src/compress/lzma2_compressor.h b/cpp/src/compress/lzma2_compressor.h
new file mode 100644
index 000000000..4a4460f46
--- /dev/null
+++ b/cpp/src/compress/lzma2_compressor.h
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef COMPRESS_LZMA2_COMPRESSOR_H
+#define COMPRESS_LZMA2_COMPRESSOR_H
+
+#include <lzma.h>
+#include <stdint.h>
+
+#include "compressor.h"
+#include "utils/errno_define.h"
+#include "utils/util_define.h"
+
+namespace storage {
+
+class LZMA2Compressor : public Compressor {
+ public:
+ LZMA2Compressor() : compressed_buf_(nullptr), uncompressed_buf_(nullptr) {}
+ ~LZMA2Compressor() OVERRIDE { destroy(); }
+
+ int reset(bool for_compress) OVERRIDE;
+ void destroy() OVERRIDE;
+ int compress(char* uncompressed_buf, uint32_t uncompressed_buf_len,
+ char*& compressed_buf, uint32_t& compressed_buf_len) OVERRIDE;
+ void after_compress(char* compressed_buf) OVERRIDE;
+ int uncompress(char* compressed_buf, uint32_t compressed_buf_len,
+ char*& uncompressed_buf,
+ uint32_t& uncompressed_buf_len) OVERRIDE;
+ void after_uncompress(char* uncompressed_buf) OVERRIDE;
+
+ private:
+ char* compressed_buf_;
+ char* uncompressed_buf_;
+};
+
+} // namespace storage
+
+#endif // COMPRESS_LZMA2_COMPRESSOR_H
diff --git a/cpp/src/compress/zstd_compressor.cc b/cpp/src/compress/zstd_compressor.cc
new file mode 100644
index 000000000..89195cc10
--- /dev/null
+++ b/cpp/src/compress/zstd_compressor.cc
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "zstd_compressor.h"
+
+#include <limits>
+
+#include "common/allocator/alloc_base.h"
+
+using namespace common;
+
+namespace storage {
+
+int ZstdCompressor::reset(bool /* for_compress */) { return E_OK; }
+
+void ZstdCompressor::destroy() {
+ if (compressed_buf_ != nullptr) {
+ mem_free(compressed_buf_);
+ compressed_buf_ = nullptr;
+ }
+ if (uncompressed_buf_ != nullptr) {
+ mem_free(uncompressed_buf_);
+ uncompressed_buf_ = nullptr;
+ }
+}
+
+int ZstdCompressor::compress(char* uncompressed_buf,
+ uint32_t uncompressed_buf_len,
+ char*& compressed_buf,
+ uint32_t& compressed_buf_len) {
+ const size_t max_dst_size = ZSTD_compressBound(uncompressed_buf_len);
+ if (max_dst_size > std::numeric_limits<uint32_t>::max()) {
+ return E_COMPRESS_ERR;
+ }
+
+ compressed_buf_ =
+ static_cast<char*>(mem_alloc(max_dst_size, MOD_COMPRESSOR_OBJ));
+ if (compressed_buf_ == nullptr) {
+ return E_OOM;
+ }
+
+ const size_t compressed_data_size =
+ ZSTD_compress(compressed_buf_, max_dst_size, uncompressed_buf,
+ uncompressed_buf_len, ZSTD_CLEVEL_DEFAULT);
+ if (ZSTD_isError(compressed_data_size)) {
+ mem_free(compressed_buf_);
+ compressed_buf_ = nullptr;
+ return E_COMPRESS_ERR;
+ }
+
+ char* compressed_data =
+ static_cast<char*>(mem_realloc(compressed_buf_, compressed_data_size));
+ if (compressed_data == nullptr) {
+ mem_free(compressed_buf_);
+ compressed_buf_ = nullptr;
+ return E_OOM;
+ }
+
+ compressed_buf_ = compressed_data;
+ compressed_buf = compressed_data;
+ compressed_buf_len = static_cast<uint32_t>(compressed_data_size);
+ return E_OK;
+}
+
+void ZstdCompressor::after_compress(char* compressed_buf) {
+ if (compressed_buf != nullptr) {
+ mem_free(compressed_buf);
+ if (compressed_buf_ == compressed_buf) {
+ compressed_buf_ = nullptr;
+ }
+ }
+}
+
+int ZstdCompressor::uncompress(char* compressed_buf,
+ uint32_t compressed_buf_len,
+ char*& uncompressed_buf,
+ uint32_t& uncompressed_buf_len) {
+ const unsigned long long content_size =
+ ZSTD_getFrameContentSize(compressed_buf, compressed_buf_len);
+ if (content_size == ZSTD_CONTENTSIZE_ERROR ||
+ content_size == ZSTD_CONTENTSIZE_UNKNOWN ||
+ content_size > std::numeric_limits<uint32_t>::max()) {
+ return E_COMPRESS_ERR;
+ }
+
+ const size_t alloc_size =
+ content_size == 0 ? 1 : static_cast<size_t>(content_size);
+ uncompressed_buf_ =
+ static_cast<char*>(mem_alloc(alloc_size, MOD_COMPRESSOR_OBJ));
+ if (uncompressed_buf_ == nullptr) {
+ return E_OOM;
+ }
+
+ const size_t decompressed_size =
+ ZSTD_decompress(uncompressed_buf_, static_cast<size_t>(content_size),
+ compressed_buf, compressed_buf_len);
+ if (ZSTD_isError(decompressed_size) || decompressed_size != content_size) {
+ mem_free(uncompressed_buf_);
+ uncompressed_buf_ = nullptr;
+ return E_COMPRESS_ERR;
+ }
+
+ uncompressed_buf = uncompressed_buf_;
+ uncompressed_buf_len = static_cast<uint32_t>(decompressed_size);
+ return E_OK;
+}
+
+void ZstdCompressor::after_uncompress(char* uncompressed_buf) {
+ if (uncompressed_buf != nullptr) {
+ mem_free(uncompressed_buf);
+ if (uncompressed_buf_ == uncompressed_buf) {
+ uncompressed_buf_ = nullptr;
+ }
+ }
+}
+
+} // namespace storage
diff --git a/cpp/src/compress/zstd_compressor.h b/cpp/src/compress/zstd_compressor.h
new file mode 100644
index 000000000..c0649f6ee
--- /dev/null
+++ b/cpp/src/compress/zstd_compressor.h
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef COMPRESS_ZSTD_COMPRESSOR_H
+#define COMPRESS_ZSTD_COMPRESSOR_H
+
+#include <stdint.h>
+#include <zstd.h>
+
+#include "compressor.h"
+#include "utils/errno_define.h"
+#include "utils/util_define.h"
+
+namespace storage {
+
+class ZstdCompressor : public Compressor {
+ public:
+ ZstdCompressor() : compressed_buf_(nullptr), uncompressed_buf_(nullptr) {}
+ ~ZstdCompressor() OVERRIDE { destroy(); }
+
+ int reset(bool for_compress) OVERRIDE;
+ void destroy() OVERRIDE;
+ int compress(char* uncompressed_buf, uint32_t uncompressed_buf_len,
+ char*& compressed_buf, uint32_t& compressed_buf_len) OVERRIDE;
+ void after_compress(char* compressed_buf) OVERRIDE;
+ int uncompress(char* compressed_buf, uint32_t compressed_buf_len,
+ char*& uncompressed_buf,
+ uint32_t& uncompressed_buf_len) OVERRIDE;
+ void after_uncompress(char* uncompressed_buf) OVERRIDE;
+
+ private:
+ char* compressed_buf_;
+ char* uncompressed_buf_;
+};
+
+} // namespace storage
+
+#endif // COMPRESS_ZSTD_COMPRESSOR_H
diff --git a/cpp/src/cwrapper/tsfile_cwrapper.h b/cpp/src/cwrapper/tsfile_cwrapper.h
index 16d392bae..73cc5389a 100644
--- a/cpp/src/cwrapper/tsfile_cwrapper.h
+++ b/cpp/src/cwrapper/tsfile_cwrapper.h
@@ -56,7 +56,10 @@ typedef enum {
TS_ENCODING_GORILLA = 8,
TS_ENCODING_ZIGZAG = 9,
TS_ENCODING_FREQ = 10,
+ TS_ENCODING_CHIMP = 11,
TS_ENCODING_SPRINTZ = 12,
+ TS_ENCODING_RLBE = 13,
+ TS_ENCODING_CAMEL = 14,
TS_ENCODING_INVALID = 255
} TSEncoding;
@@ -69,6 +72,8 @@ typedef enum {
TS_COMPRESSION_PAA = 5,
TS_COMPRESSION_PLA = 6,
TS_COMPRESSION_LZ4 = 7,
+ TS_COMPRESSION_ZSTD = 8,
+ TS_COMPRESSION_LZMA2 = 9,
TS_COMPRESSION_INVALID = 255
} CompressionType;
@@ -339,7 +344,7 @@ uint8_t get_global_compression();
* @brief Sets the global time column encoding method
*
* Validates and sets the encoding type for time series timestamps.
- * Supported encodings: TS_2DIFF, PLAIN, GORILLA, ZIGZAG, RLE, SPRINTZ
+ * Supported encodings: PLAIN, TS_2DIFF
*
* @param encoding The encoding type to set (as uint8_t)
* @return int E_OK on success, E_NOT_SUPPORT for invalid encoding
@@ -350,7 +355,7 @@ int set_global_time_encoding(uint8_t encoding);
* @brief Sets the global time column compression method
*
* Validates and sets the compression type for time series timestamps.
- * Supported compressions: UNCOMPRESSED, SNAPPY, GZIP, LZO, LZ4
+ * Supported compressions: UNCOMPRESSED, SNAPPY, GZIP, LZO, LZ4, ZSTD, LZMA2
*
* @param compression The compression type to set (as uint8_t)
* @return int E_OK on success, E_NOT_SUPPORT for invalid compression
@@ -365,8 +370,10 @@ int set_global_time_compression(uint8_t compression);
* data type
* @note Supported encodings per data type:
* - BOOLEAN: PLAIN only
- * - INT32/INT64: PLAIN, TS_2DIFF, GORILLA, ZIGZAG, RLE, SPRINTZ
- * - FLOAT/DOUBLE: PLAIN, TS_2DIFF, GORILLA, SPRINTZ
+ * - INT32/DATE/INT64/TIMESTAMP: PLAIN, TS_2DIFF, GORILLA, ZIGZAG, RLE,
+ * SPRINTZ, CHIMP, RLBE
+ * - FLOAT: PLAIN, TS_2DIFF, GORILLA, SPRINTZ, CHIMP, RLBE
+ * - DOUBLE: PLAIN, TS_2DIFF, GORILLA, SPRINTZ, CHIMP, RLBE, CAMEL
* - STRING: PLAIN, DICTIONARY
*/
int set_datatype_encoding(uint8_t data_type, uint8_t encoding);
@@ -375,7 +382,8 @@ int set_datatype_encoding(uint8_t data_type, uint8_t encoding);
* @brief Set the global default compression type
* @param compression Compression type to set
* @return E_OK if success, E_NOT_SUPPORT if compression is not supported
- * @note Supported compressions: UNCOMPRESSED, SNAPPY, GZIP, LZO, LZ4
+ * @note Supported compressions: UNCOMPRESSED, SNAPPY, GZIP, LZO, LZ4, ZSTD,
+ * LZMA2
*/
int set_global_compression(uint8_t compression);
diff --git a/cpp/src/encoding/bit_packing_utils.h b/cpp/src/encoding/bit_packing_utils.h
new file mode 100644
index 000000000..ad15e6146
--- /dev/null
+++ b/cpp/src/encoding/bit_packing_utils.h
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef ENCODING_BIT_PACKING_UTILS_H
+#define ENCODING_BIT_PACKING_UTILS_H
+
+#include <stdint.h>
+
+#include "common/allocator/byte_stream.h"
+#include "utils/errno_define.h"
+#include "utils/util_define.h"
+
+namespace storage {
+
+class MsbBitWriter {
+ public:
+ MsbBitWriter() { reset(); }
+
+ void reset() {
+ buffer_ = 0;
+ bits_left_ = 8;
+ bits_written_ = 0;
+ }
+
+ int write_bit(bool value, common::ByteStream& out) {
+ if (value) {
+ buffer_ |= static_cast<uint8_t>(1U << (bits_left_ - 1));
+ }
+ --bits_left_;
+ ++bits_written_;
+ return flush_byte_if_full(out);
+ }
+
+ int write_bits(uint64_t value, int bits, common::ByteStream& out) {
+ int ret = common::E_OK;
+ while (bits > 0) {
+ int shift = bits - bits_left_;
+ if (shift >= 0) {
+ uint8_t mask = static_cast<uint8_t>((1U << bits_left_) - 1U);
+ buffer_ |= static_cast<uint8_t>((value >> shift) & mask);
+ bits -= bits_left_;
+ bits_written_ += bits_left_;
+ bits_left_ = 0;
+ } else {
+ shift = bits_left_ - bits;
+ uint64_t mask = bits == 64 ? UINT64_MAX : ((1ULL << bits) - 1);
+ buffer_ |= static_cast<uint8_t>((value & mask) << shift);
+ bits_written_ += bits;
+ bits_left_ -= bits;
+ bits = 0;
+ }
+ if (RET_FAIL(flush_byte_if_full(out))) {
+ return ret;
+ }
+ }
+ return ret;
+ }
+
+ int flush_partial(common::ByteStream& out) {
+ if (bits_left_ == 8) {
+ return common::E_OK;
+ }
+ uint8_t byte = buffer_;
+ int ret = out.write_buf(&byte, 1);
+ buffer_ = 0;
+ bits_left_ = 8;
+ return ret;
+ }
+
+ int flush_forced(common::ByteStream& out) {
+ bits_left_ = 0;
+ return flush_byte_if_full(out);
+ }
+
+ int bits_written() const { return bits_written_; }
+
+ private:
+ int flush_byte_if_full(common::ByteStream& out) {
+ if (bits_left_ != 0) {
+ return common::E_OK;
+ }
+ uint8_t byte = buffer_;
+ int ret = out.write_buf(&byte, 1);
+ buffer_ = 0;
+ bits_left_ = 8;
+ return ret;
+ }
+
+ uint8_t buffer_;
+ int bits_left_;
+ int bits_written_;
+};
+
+class MsbBitReader {
+ public:
+ MsbBitReader() { reset(); }
+
+ void reset() {
+ buffer_ = 0;
+ bits_left_ = 0;
+ }
+
+ int read_bit(bool& value, common::ByteStream& in) {
+ int ret = common::E_OK;
+ if (bits_left_ == 0 && RET_FAIL(load_byte(in))) {
+ return ret;
+ }
+ value = ((buffer_ >> (bits_left_ - 1)) & 1U) != 0;
+ --bits_left_;
+ return common::E_OK;
+ }
+
+ int read_bits(uint64_t& value, int bits, common::ByteStream& in) {
+ int ret = common::E_OK;
+ value = 0;
+ while (bits > 0) {
+ if (bits_left_ == 0 && RET_FAIL(load_byte(in))) {
+ return ret;
+ }
+ if (bits > bits_left_ || bits == 8) {
+ uint8_t mask = static_cast<uint8_t>((1U << bits_left_) - 1U);
+ value = (value << bits_left_) + (buffer_ & mask);
+ bits -= bits_left_;
+ bits_left_ = 0;
+ } else {
+ uint8_t mask = static_cast<uint8_t>((1U << bits) - 1U);
+ uint8_t data = static_cast<uint8_t>(
+ (buffer_ >> (bits_left_ - bits)) & mask);
+ value = (value << bits) + data;
+ bits_left_ -= bits;
+ bits = 0;
+ }
+ }
+ return ret;
+ }
+
+ int align_to_byte(common::ByteStream& in) {
+ bool ignored = false;
+ int ret = common::E_OK;
+ while (bits_left_ > 0) {
+ if (RET_FAIL(read_bit(ignored, in))) {
+ return ret;
+ }
+ }
+ return ret;
+ }
+
+ bool has_cached_bits() const { return bits_left_ > 0; }
+
+ private:
+ int load_byte(common::ByteStream& in) {
+ uint32_t read_len = 0;
+ int ret = in.read_buf(&buffer_, 1, read_len);
+ if (ret != common::E_OK || read_len != 1) {
+ return common::E_BUF_NOT_ENOUGH;
+ }
+ bits_left_ = 8;
+ return common::E_OK;
+ }
+
+ uint8_t buffer_;
+ int bits_left_;
+};
+
+} // namespace storage
+
+#endif // ENCODING_BIT_PACKING_UTILS_H
diff --git a/cpp/src/encoding/camel_decoder.h b/cpp/src/encoding/camel_decoder.h
new file mode 100644
index 000000000..fd50d86f8
--- /dev/null
+++ b/cpp/src/encoding/camel_decoder.h
@@ -0,0 +1,352 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef ENCODING_CAMEL_DECODER_H
+#define ENCODING_CAMEL_DECODER_H
+
+#include <stdint.h>
+
+#include <limits>
+
+#include "bit_packing_utils.h"
+#include "camel_encoder.h"
+#include "common/allocator/byte_stream.h"
+#include "common/db_common.h"
+#include "decoder.h"
+#include "utils/errno_define.h"
+#include "utils/util_define.h"
+
+namespace storage {
+
+class CamelDecoder : public Decoder {
+ public:
+ CamelDecoder() { reset(); }
+ ~CamelDecoder() override = default;
+
+ void reset() override {
+ type_ = common::CAMEL;
+ is_first_ = true;
+ stored_val_ = 0;
+ previous_value_ = 0;
+ scale_ = 1;
+ leading_zeros_ = std::numeric_limits<int>::max();
+ trailing_zeros_ = 0;
+ bits_remaining_ = 0;
+ bit_reader_.reset();
+ }
+
+ bool has_remaining(const common::ByteStream& buffer) override {
+ return bits_remaining_ > 0 || buffer.has_remaining();
+ }
+
+ int read_boolean(bool&, common::ByteStream&) override {
+ return common::E_TYPE_NOT_MATCH;
+ }
+ int read_int32(int32_t&, common::ByteStream&) override {
+ return common::E_TYPE_NOT_MATCH;
+ }
+ int read_int64(int64_t&, common::ByteStream&) override {
+ return common::E_TYPE_NOT_MATCH;
+ }
+ int read_float(float&, common::ByteStream&) override {
+ return common::E_TYPE_NOT_MATCH;
+ }
+ int read_String(common::String&, common::PageArena&,
+ common::ByteStream&) override {
+ return common::E_TYPE_NOT_MATCH;
+ }
+
+ int read_double(double& ret_value, common::ByteStream& in) override {
+ int ret = common::E_OK;
+ if (bits_remaining_ == 0 && RET_FAIL(read_block_header(in))) {
+ return ret;
+ }
+ if (is_first_) {
+ uint64_t bits = 0;
+ if (RET_FAIL(
+ read_bits(bits, camel_detail::BITS_FOR_FIRST_VALUE, in))) {
+ return ret;
+ }
+ ret_value = camel_detail::long_bits_to_double(bits);
+ stored_val_ = camel_detail::java_double_to_long(ret_value);
+ is_first_ = false;
+ } else if (RET_FAIL(read_next_value(ret_value, in))) {
+ return ret;
+ }
+ previous_value_ = camel_detail::java_double_to_long_bits(ret_value);
+ if (bits_remaining_ == 0) {
+ bit_reader_.reset();
+ }
+ return common::E_OK;
+ }
+
+ private:
+ int read_block_header(common::ByteStream& in) {
+ int ret = common::E_OK;
+ int32_t block_bits = 0;
+ if (RET_FAIL(common::SerializationUtil::read_var_int(block_bits, in))) {
+ return ret;
+ }
+ if (block_bits <= 0) {
+ return common::E_TSFILE_CORRUPTED;
+ }
+ is_first_ = true;
+ stored_val_ = 0;
+ previous_value_ = 0;
+ scale_ = 1;
+ leading_zeros_ = std::numeric_limits<int>::max();
+ trailing_zeros_ = 0;
+ bits_remaining_ = block_bits;
+ bit_reader_.reset();
+ return common::E_OK;
+ }
+
+ int read_bit(bool& value, common::ByteStream& in) {
+ if (bits_remaining_ < 1) {
+ return common::E_BUF_NOT_ENOUGH;
+ }
+ int ret = bit_reader_.read_bit(value, in);
+ if (ret == common::E_OK) {
+ --bits_remaining_;
+ }
+ return ret;
+ }
+
+ int read_bits(uint64_t& value, int bits, common::ByteStream& in) {
+ if (bits < 0 || bits_remaining_ < bits) {
+ return common::E_BUF_NOT_ENOUGH;
+ }
+ int ret = bit_reader_.read_bits(value, bits, in);
+ if (ret == common::E_OK) {
+ bits_remaining_ -= bits;
+ }
+ return ret;
+ }
+
+ int read_int_bits(int& value, int bits, common::ByteStream& in) {
+ uint64_t data = 0;
+ int ret = read_bits(data, bits, in);
+ if (ret == common::E_OK) {
+ value = static_cast<int>(data);
+ }
+ return ret;
+ }
+
+ int read_next_value(double& value, common::ByteStream& in) {
+ int ret = common::E_OK;
+ int sign_bit = 0;
+ int type_bit = 0;
+ if (RET_FAIL(
+ read_int_bits(sign_bit, camel_detail::BITS_FOR_SIGN, in)) ||
+ RET_FAIL(
+ read_int_bits(type_bit, camel_detail::BITS_FOR_TYPE, in))) {
+ return ret;
+ }
+ double sign = sign_bit == 1 ? -1.0 : 1.0;
+ if (type_bit == 1) {
+ int64_t int_part = 0;
+ double dec_part = 0;
+ if (RET_FAIL(read_camel_long(int_part, in)) ||
+ RET_FAIL(read_decimal(dec_part, in))) {
+ return ret;
+ }
+ double abs_value =
+ int_part >= 0
+ ? (static_cast<double>(int_part) * scale_ + dec_part) /
+ scale_
+ : -(static_cast<double>(int_part) * scale_ + dec_part) /
+ scale_;
+ value = sign * abs_value;
+ return common::E_OK;
+ }
+
+ double gorilla_value = 0;
+ if (RET_FAIL(decode_gorilla(gorilla_value, in))) {
+ return ret;
+ }
+ value = sign * gorilla_value;
+ return common::E_OK;
+ }
+
+ int read_camel_long(int64_t& value, common::ByteStream& in) {
+ int ret = common::E_OK;
+ int64_t diff = 0;
+ if (RET_FAIL(read_var_long(diff, in))) {
+ return ret;
+ }
+ stored_val_ = static_cast<int64_t>(
+ camel_detail::add_as_java_long(stored_val_, diff));
+ value = stored_val_;
+ return common::E_OK;
+ }
+
+ int read_decimal(double& value, common::ByteStream& in) {
+ int ret = common::E_OK;
+ int count = 0;
+ if (RET_FAIL(read_int_bits(count, camel_detail::BITS_FOR_DECIMAL_COUNT,
+ in))) {
+ return ret;
+ }
+ ++count;
+ if (count < 1 || count > camel_detail::DECODER_DECIMAL_MAX_COUNT) {
+ return common::E_TSFILE_CORRUPTED;
+ }
+
+ bool has_xor = false;
+ if (RET_FAIL(read_bit(has_xor, in))) {
+ return ret;
+ }
+ uint64_t xor_value = 0;
+ if (has_xor) {
+ uint64_t bits = 0;
+ if (RET_FAIL(read_bits(bits, count, in))) {
+ return ret;
+ }
+ xor_value = bits << (camel_detail::DOUBLE_MANTISSA_BITS - count);
+ }
+
+ int64_t m_value = 0;
+ if (RET_FAIL(read_var_long(m_value, in))) {
+ return ret;
+ }
+
+ int64_t pow = camel_detail::POWERS_10[count - 1];
+ double frac = 0;
+ if (has_xor) {
+ double base =
+ static_cast<double>(m_value) / static_cast<double>(pow) + 1;
+ uint64_t merged =
+ xor_value ^ camel_detail::java_double_to_long_bits(base);
+ frac = camel_detail::long_bits_to_double(merged) - 1;
+ } else {
+ frac = static_cast<double>(m_value) / static_cast<double>(pow);
+ }
+
+ scale_ = static_cast<double>(pow);
+ value =
+ static_cast<double>(camel_detail::java_math_round(frac * scale_));
+ return common::E_OK;
+ }
+
+ int read_var_long(int64_t& value, common::ByteStream& in) {
+ int ret = common::E_OK;
+ uint64_t result = 0;
+ int shift = 0;
+ while (true) {
+ uint64_t chunk = 0;
+ bool has_next = false;
+ if (RET_FAIL(read_bits(chunk, 7, in)) ||
+ RET_FAIL(read_bit(has_next, in))) {
+ return ret;
+ }
+ result |= chunk << shift;
+ shift += 7;
+ if (!has_next) {
+ break;
+ }
+ if (shift >= 64) {
+ return common::E_TSFILE_CORRUPTED;
+ }
+ }
+ uint64_t decoded = (result >> 1) ^ (UINT64_C(0) - (result & 1U));
+ value = static_cast<int64_t>(decoded);
+ return common::E_OK;
+ }
+
+ int decode_gorilla(double& value, common::ByteStream& in) {
+ int ret = common::E_OK;
+ if (is_first_) {
+ uint64_t bits = 0;
+ if (RET_FAIL(
+ read_bits(bits, camel_detail::BITS_FOR_FIRST_VALUE, in))) {
+ return ret;
+ }
+ previous_value_ = bits;
+ is_first_ = false;
+ value = camel_detail::long_bits_to_double(previous_value_);
+ return common::E_OK;
+ }
+
+ bool control_bit = false;
+ if (RET_FAIL(read_bit(control_bit, in))) {
+ return ret;
+ }
+ if (!control_bit) {
+ value = camel_detail::long_bits_to_double(previous_value_);
+ return common::E_OK;
+ }
+
+ bool write_new_block = false;
+ if (RET_FAIL(read_bit(write_new_block, in))) {
+ return ret;
+ }
+ uint64_t xor_value = 0;
+ if (!write_new_block) {
+ int significant_bits = camel_detail::DOUBLE_TOTAL_BITS -
+ leading_zeros_ - trailing_zeros_;
+ if (significant_bits == 0) {
+ value = camel_detail::long_bits_to_double(previous_value_);
+ return common::E_OK;
+ }
+ if (RET_FAIL(read_bits(xor_value, significant_bits, in))) {
+ return ret;
+ }
+ xor_value <<= trailing_zeros_;
+ } else {
+ int significant_bits = 0;
+ if (RET_FAIL(read_int_bits(leading_zeros_,
+ camel_detail::BITS_FOR_LEADING_ZEROS,
+ in)) ||
+ RET_FAIL(read_int_bits(significant_bits,
+ camel_detail::BITS_FOR_SIGNIFICANT_BITS,
+ in))) {
+ return ret;
+ }
+ ++significant_bits;
+ trailing_zeros_ = camel_detail::DOUBLE_TOTAL_BITS - leading_zeros_ -
+ significant_bits;
+ if (trailing_zeros_ < 0) {
+ return common::E_TSFILE_CORRUPTED;
+ }
+ if (RET_FAIL(read_bits(xor_value, significant_bits, in))) {
+ return ret;
+ }
+ xor_value <<= trailing_zeros_;
+ }
+
+ previous_value_ ^= xor_value;
+ value = camel_detail::long_bits_to_double(previous_value_);
+ return common::E_OK;
+ }
+
+ private:
+ common::TSEncoding type_;
+ bool is_first_;
+ int64_t stored_val_;
+ uint64_t previous_value_;
+ double scale_;
+ int leading_zeros_;
+ int trailing_zeros_;
+ int bits_remaining_;
+ MsbBitReader bit_reader_;
+};
+
+} // namespace storage
+
+#endif // ENCODING_CAMEL_DECODER_H
diff --git a/cpp/src/encoding/camel_encoder.h b/cpp/src/encoding/camel_encoder.h
new file mode 100644
index 000000000..aa892de90
--- /dev/null
+++ b/cpp/src/encoding/camel_encoder.h
@@ -0,0 +1,444 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef ENCODING_CAMEL_ENCODER_H
+#define ENCODING_CAMEL_ENCODER_H
+
+#include <math.h>
+#include <stdint.h>
+
+#include <limits>
+
+#include "bit_packing_utils.h"
+#include "common/allocator/byte_stream.h"
+#include "common/db_common.h"
+#include "encode_utils.h"
+#include "encoder.h"
+#include "utils/errno_define.h"
+#include "utils/util_define.h"
+
+namespace storage {
+
+namespace camel_detail {
+
+static constexpr int BITS_FOR_SIGN = 1;
+static constexpr int BITS_FOR_TYPE = 1;
+static constexpr int BITS_FOR_FIRST_VALUE = 64;
+static constexpr int BITS_FOR_LEADING_ZEROS = 6;
+static constexpr int BITS_FOR_SIGNIFICANT_BITS = 6;
+static constexpr int BITS_FOR_DECIMAL_COUNT = 4;
+static constexpr int DOUBLE_TOTAL_BITS = 64;
+static constexpr int DOUBLE_MANTISSA_BITS = 52;
+static constexpr int ENCODER_DECIMAL_MAX_COUNT = 10;
+static constexpr int DECODER_DECIMAL_MAX_COUNT = 15;
+
... 1131718 lines suppressed ...