Open
Conversation
Add a read-only library target (aaruformatread) alongside the existing full read/write target (aaruformat). The reader target excludes four writer-only source files: create.c, write.c, close_write.c, and metadata_write.c. Writer functions in shared source files are guarded with #ifndef AARUFORMAT_READER_ONLY so the reader target exports zero writer symbols: - open.c: resume-mode block (sets finalize_write, calls create_map) - ddt/ddt_v2.c: set_ddt_* functions (call aaruf_close_current_block) - dump.c: aaruf_set_dumphw - blocks/optical.c: aaruf_set_tracks - blocks/tape.c: aaruf_set_tape_file, aaruf_set_tape_partition - blocks/flux.c: aaruf_write_flux_capture, aaruf_clear_flux_captures CMakeLists.txt refactored to use AARUFORMAT_COMMON_SOURCES and AARUFORMAT_WRITER_SOURCES variables. Both targets share the same include directories, third-party dependencies, and compiler flags via a foreach loop over AARUFORMAT_TARGETS. Verified: - Both targets build cleanly (shared libraries) - Full test suite passes (163/165, 2 pre-existing failures) - nm -D libaaruformatread.so shows zero set_/clear_/write_/create symbols - Reader library is ~1 MB vs ~5 MB for the full library
Collaborator
|
should get also in build.sh and a nuget package don't you think? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a read-only library target (aaruformatread) alongside the existing full read/write target (aaruformat). The reader target excludes four writer-only source files: create.c, write.c, close_write.c, and metadata_write.c.
Writer functions in shared source files are guarded with #ifndef AARUFORMAT_READER_ONLY so the reader target exports zero writer symbols:
CMakeLists.txt refactored to use AARUFORMAT_COMMON_SOURCES and AARUFORMAT_WRITER_SOURCES variables. Both targets share the same include directories, third-party dependencies, and compiler flags via a foreach loop over AARUFORMAT_TARGETS.
Verified: