-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define the Zarr streaming API #291
Changes from 12 commits
30560f3
a612210
72cfe47
e5afc9d
4ef1c86
18ac6d4
4397b75
ed8be14
6843827
9b397c6
6a4aa86
6cae047
3fa201c
e5bce03
d808a25
250c661
96b580a
180b8cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,54 @@ | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
||
####### Acquire Zarr Streaming Library ####### | ||
|
||
set(tgt acquire-zarr) | ||
|
||
add_library(${tgt} STATIC | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's best practice to let users decide whether to build a library as static or shared. While CMake defaults to |
||
include/zarr.h | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's standard practice to place the include folder containing public headers outside the src directory. This separation clearly distinguishes the public interface from implementation details and simplifies integration for users. |
||
internal/logger.hh | ||
internal/logger.cpp | ||
internal/stream.settings.hh | ||
internal/stream.settings.cpp | ||
internal/zarr.stream.hh | ||
internal/zarr.stream.cpp | ||
) | ||
|
||
target_include_directories(${tgt} | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
PRIVATE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/internal> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you choose to name a directory |
||
) | ||
|
||
target_link_libraries(${tgt} PRIVATE | ||
blosc_static | ||
miniocpp::miniocpp | ||
) | ||
|
||
set_target_properties(${tgt} PROPERTIES | ||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" | ||
) | ||
|
||
install(TARGETS ${tgt} | ||
LIBRARY DESTINATION lib | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The presence of a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain what you mean by that? |
||
ARCHIVE DESTINATION lib | ||
) | ||
|
||
# Install public header files | ||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I typically use |
||
DESTINATION include | ||
FILES_MATCHING PATTERN "*.h" | ||
) | ||
|
||
####### Acquire Zarr Driver ####### | ||
|
||
if (NOT TARGET acquire-core-logger) | ||
add_subdirectory(../acquire-common/acquire-core-libs ${CMAKE_CURRENT_BINARY_DIR}/acquire-core-libs) | ||
endif () | ||
|
||
set(tgt acquire-driver-zarr) | ||
add_library(${tgt} MODULE | ||
set(tgt-driver acquire-driver-zarr) | ||
add_library(${tgt-driver} MODULE | ||
common/dimension.hh | ||
common/dimension.cpp | ||
common/thread.pool.hh | ||
|
@@ -36,12 +81,12 @@ add_library(${tgt} MODULE | |
zarr.driver.c | ||
) | ||
|
||
target_include_directories(${tgt} PRIVATE | ||
target_include_directories(${tgt-driver} PRIVATE | ||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> | ||
) | ||
|
||
target_enable_simd(${tgt}) | ||
target_link_libraries(${tgt} PRIVATE | ||
target_enable_simd(${tgt-driver}) | ||
target_link_libraries(${tgt-driver} PRIVATE | ||
acquire-core-logger | ||
acquire-core-platform | ||
acquire-device-kit | ||
|
@@ -50,8 +95,8 @@ target_link_libraries(${tgt} PRIVATE | |
nlohmann_json::nlohmann_json | ||
miniocpp::miniocpp | ||
) | ||
set_target_properties(${tgt} PROPERTIES | ||
set_target_properties(${tgt-driver} PROPERTIES | ||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" | ||
) | ||
|
||
install(TARGETS ${tgt} LIBRARY DESTINATION lib) | ||
install(TARGETS ${tgt-driver} LIBRARY DESTINATION lib) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add some information about why "streaming" is now the primary target? Additionally, would it be more effective to organize the code by placing all "driver" code in one folder and "streaming" code in another? This approach would allow each subfolder to have its own CMake file defining its target, rather than having a single CMake file defining two targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point, the streaming code is going to go into its own repo, but this is probably a good opportunity to separate them.