Skip to content

Commit

Permalink
Merge pull request #332 from salvete/erofs-io-incremental
Browse files Browse the repository at this point in the history
Add erofs-util API support for overlaybd
  • Loading branch information
BigVan authored Jun 27, 2024
2 parents 0edcc6b + 652bc76 commit 6c1bf35
Show file tree
Hide file tree
Showing 7 changed files with 753 additions and 181 deletions.
3 changes: 3 additions & 0 deletions src/overlaybd/tar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ target_include_directories(tar_lib PUBLIC
if(BUILD_TESTING)
add_subdirectory(test)
endif()

add_subdirectory(erofs)
target_link_libraries(tar_lib PRIVATE erofs_lib)
43 changes: 43 additions & 0 deletions src/overlaybd/tar/erofs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
include(FetchContent)

FetchContent_Declare(
erofs-utils
GIT_REPOSITORY https://gitee.com/anolis/erofs-utils.git
GIT_TAG overlaybd-dev-2
)

FetchContent_MakeAvailable(erofs-utils)

execute_process(
COMMAND ./autogen.sh
WORKING_DIRECTORY ${erofs-utils_SOURCE_DIR}
)
execute_process(
COMMAND ./configure --disable-lz4 --without-liblzma --without-libzstd
WORKING_DIRECTORY ${erofs-utils_SOURCE_DIR}
)
execute_process(
COMMAND make
WORKING_DIRECTORY ${erofs-utils_SOURCE_DIR}
)

set(EROFS_LIB_INCLUDE_DIR "${erofs-utils_SOURCE_DIR}/include/" CACHE PATH "erofs-utils include path.")
set(EROFS_CONFIG_FILE "${erofs-utils_SOURCE_DIR}/config.h" CACHE PATH "erofs-utils config file.")
set(EROFS_LIB_STATIC "${erofs-utils_SOURCE_DIR}/lib/.libs/liberofs.a" CACHE PATH "erofs-utils static lib.")

file(GLOB EROFS_SOURCE "*.cpp")

add_library(erofs_lib STATIC ${EROFS_SOURCE})

target_include_directories(erofs_lib PRIVATE
${PHOTON_INCLUDE_DIR}
)

target_include_directories(erofs_lib PRIVATE
${EROFS_LIB_INCLUDE_DIR}
)

target_link_libraries(erofs_lib PRIVATE uuid)

target_compile_options(erofs_lib PRIVATE "-include${EROFS_CONFIG_FILE}")
target_link_libraries(erofs_lib PRIVATE ${EROFS_LIB_STATIC})
Loading

0 comments on commit 6c1bf35

Please sign in to comment.