aboutsummaryrefslogtreecommitdiff
path: root/libs/libbsarch/CMakeLists.txt
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 17:55:56 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-12 17:55:56 -0500
commit892070f3dec1dc690983fd862880e37e711c2516 (patch)
tree423da9fca609a9239efbb6c74ab2e8657975c5a4 /libs/libbsarch/CMakeLists.txt
parenta0355c9b897281d0bfea48bec9d490724ecabd96 (diff)
Add BSA in-memory extraction and nested preview support
bsatk: - Archive::extractToMemory() extracts a file directly into a byte buffer instead of a filesystem path, backed by a std::ostringstream sink. - Archive::findFile() locates a file by relative path, case-insensitive and separator-agnostic, walking the folder tree recursively. - extractDirect/extractCompressed now take std::ostream& so both the ofstream and ostringstream paths share the same implementation. libbsarch: shim rewrite on Linux to map the Windows API surface onto bsatk::Archive, enabling preview_bsa to open vanilla BSAs via the same interface as other plugins. preview_bsa: double-click on a file in the BSA tree now extracts the bytes via extractToMemory() and hands them to IOrganizer::previewFileData for nested preview rendering (e.g. NIF inside a BSA). uibase + organizerproxy + organizercore: new IOrganizer::previewFileData virtual that routes in-memory file bytes through the first registered IPluginPreview matching the extension. Uses heap + WA_DeleteOnClose + open() to avoid nested exec() softlock from mod info filetree -> preview_bsa tree -> nif preview. docker/build-inner.sh: stage preview_nif shaders into plugin_data/shaders so ShaderManager can load them via IOrganizer::getPluginDataPath(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'libs/libbsarch/CMakeLists.txt')
-rw-r--r--libs/libbsarch/CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/libbsarch/CMakeLists.txt b/libs/libbsarch/CMakeLists.txt
index d3e994e..db92b91 100644
--- a/libs/libbsarch/CMakeLists.txt
+++ b/libs/libbsarch/CMakeLists.txt
@@ -29,12 +29,24 @@ else()
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include
FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/libbsarch/libbsarch.h
)
- # Set default symbol visibility to hidden, export only marked symbols
+ # Set default symbol visibility to hidden, export only marked symbols.
+ # libbsarch.cpp uses BSARCH_DLL_API which maps to
+ # __attribute__((visibility("default"))) when BSARCH_DLL_EXPORT is set,
+ # so the C API stays exported while the bsatk bridge stays internal.
target_compile_options(libbsarch PRIVATE -fvisibility=hidden)
endif()
target_include_directories(libbsarch PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/libbsarch)
-set_target_properties(libbsarch PROPERTIES DEBUG_POSTFIX "d" CXX_STANDARD 11)
+if(WIN32)
+ set_target_properties(libbsarch PROPERTIES DEBUG_POSTFIX "d" CXX_STANDARD 11)
+else()
+ # Linux impl is backed by bsatk and needs C++17 for std::string::data()
+ # non-const and the rest of the bsatk API.
+ set_target_properties(libbsarch PROPERTIES DEBUG_POSTFIX "d" CXX_STANDARD 17)
+endif()
target_link_libraries(libbsarch PUBLIC mo2::dds-header)
+if(NOT WIN32)
+ target_link_libraries(libbsarch PRIVATE mo2::bsatk)
+endif()
target_compile_definitions(libbsarch PRIVATE BSARCH_DLL_EXPORT)
# preprocessor definitions