Skip to content

Commit

Permalink
Add protobuf dep to ccpp
Browse files Browse the repository at this point in the history
  • Loading branch information
netheril96 committed Feb 26, 2024
1 parent d338037 commit 4663bb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ccpp.yml
Expand Up @@ -46,7 +46,7 @@ jobs:
with:
python-version: "3.x"
- name: install
run: sudo apt-get install fuse libfuse-dev libcrypto++-dev libargon2-dev libtclap-dev libabsl-dev libutf8proc-dev libjsoncpp-dev doctest-dev
run: sudo apt-get update && sudo apt-get install fuse libfuse-dev libcrypto++-dev libargon2-dev libtclap-dev libabsl-dev libutf8proc-dev libjsoncpp-dev doctest-dev libprotobuf-dev protobuf-compiler cmake-data
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DSECUREFS_USE_VCPKG=OFF ..
- name: build
Expand Down
15 changes: 8 additions & 7 deletions CMakeLists.txt
Expand Up @@ -55,13 +55,6 @@ file(GLOB TEST_SOURCES test/*.h test/*.cpp)
add_library(securefs-static STATIC ${SOURCES})
link_libraries(securefs-static)

find_package(Protobuf CONFIG REQUIRED)
protobuf_generate(TARGET securefs-static IMPORT_DIRS protos PROTOC_OUT_DIR
${CMAKE_CURRENT_BINARY_DIR}/out/)
target_include_directories(securefs-static
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/out/)
target_link_libraries(securefs-static PUBLIC protobuf::libprotobuf)

if(MSVC)
add_executable(securefs main.cpp securefs.manifest)
else()
Expand All @@ -86,6 +79,7 @@ if(SECUREFS_USE_VCPKG)
target_link_libraries(securefs-static PUBLIC unofficial::argon2::libargon2)
find_package(jsoncpp CONFIG REQUIRED)
target_link_libraries(securefs-static PUBLIC JsonCpp::JsonCpp)
find_package(Protobuf CONFIG REQUIRED)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(UTF8PROC REQUIRED libutf8proc)
Expand All @@ -100,8 +94,15 @@ else()

find_library(CRYPTOPP_FLAGS NAMES cryptopp crypto++)
target_link_libraries(securefs-static PUBLIC ${CRYPTOPP_FLAGS})
find_package(Protobuf REQUIRED)

endif()

target_link_libraries(securefs-static PUBLIC protobuf::libprotobuf)
protobuf_generate(TARGET securefs-static IMPORT_DIRS protos PROTOC_OUT_DIR
${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(securefs-static PUBLIC ${CMAKE_CURRENT_BINARY_DIR})

if(CMAKE_DL_LIBS)
target_link_libraries(securefs-static PUBLIC ${CMAKE_DL_LIBS})
endif()
Expand Down

0 comments on commit 4663bb8

Please sign in to comment.