Skip to content

Commit

Permalink
replaced bedrock with bedrock-module-api
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Jul 3, 2024
1 parent e94e307 commit b7bfc09
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
23 changes: 15 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ project (warabi C CXX)
set (CMAKE_CXX_STANDARD 17)
enable_testing ()

# library version set here (e.g. for shared libs).
set (WARABI_VERSION_MAJOR 0)
set (WARABI_VERSION_MINOR 4)
set (WARABI_VERSION_PATCH 0)
set (WARABI_VERSION
"${WARABI_VERSION_MAJOR}.${WARABI_VERSION_MINOR}.${WARABI_VERSION_PATCH}")

add_definitions (-Wextra -Wall -Wpedantic)

add_library (coverage_config INTERFACE)
Expand Down Expand Up @@ -64,7 +71,7 @@ pkg_check_modules (libpmemobj REQUIRED IMPORTED_TARGET libpmemobj)
pkg_check_modules (abt-io REQUIRED IMPORTED_TARGET abt-io)
# search of bedrock if needed
if (${ENABLE_BEDROCK})
find_package (bedrock REQUIRED)
find_package (bedrock-module-api REQUIRED)
endif ()
if (${ENABLE_REMI})
find_package (remi REQUIRED)
Expand All @@ -73,13 +80,6 @@ else ()
set (WARABI_HAS_REMI OFF)
endif ()

# library version set here (e.g. for shared libs).
set (WARABI_VERSION_MAJOR 0)
set (WARABI_VERSION_MINOR 3)
set (WARABI_VERSION_PATCH 0)
set (WARABI_VERSION
"${WARABI_VERSION_MAJOR}.${WARABI_VERSION_MINOR}.${WARABI_VERSION_PATCH}")

add_subdirectory (src)
if (${ENABLE_TESTS})
enable_testing ()
Expand All @@ -91,6 +91,13 @@ if (${ENABLE_TESTS})
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1
)
# library version set here (e.g. for shared libs).
set (WARABI_VERSION_MAJOR 0)
set (WARABI_VERSION_MINOR 3)
set (WARABI_VERSION_PATCH 0)
set (WARABI_VERSION
"${WARABI_VERSION_MAJOR}.${WARABI_VERSION_MINOR}.${WARABI_VERSION_PATCH}")

FetchContent_MakeAvailable (Catch2)
endif ()
add_subdirectory (tests)
Expand Down
2 changes: 1 addition & 1 deletion spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spack:
- spdlog
- fmt
- tclap
- mochi-bedrock +abtio
- mochi-bedrock-module-api
- mochi-abt-io
- mochi-remi
concretizer:
Expand Down
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ else ()
set (OPTIONAL_REMI)
endif ()
add_library (warabi-server ${server-src-files})
add_library (warabi::server ALIAS warabi-server)
target_link_libraries (warabi-server
PUBLIC thallium nlohmann_json::nlohmann_json ${OPTIONAL_REMI}
PRIVATE ${OPTIONAL_REMI} nlohmann_json_schema_validator::validator
Expand All @@ -49,6 +50,7 @@ set_target_properties (warabi-server

# client library
add_library (warabi-client ${client-src-files})
add_library (warabi::client ALIAS warabi-client)
target_link_libraries (warabi-client
PUBLIC thallium nlohmann_json::nlohmann_json
PRIVATE spdlog::spdlog fmt::fmt coverage_config)
Expand All @@ -63,6 +65,7 @@ set_target_properties (warabi-client

# C error library
add_library (warabi-c-error ${CMAKE_CURRENT_SOURCE_DIR}/c/error.cpp)
add_library (warabi::c-error ALIAS warabi-c-error)
target_link_libraries (warabi-c-error PRIVATE warabi-client coverage_config)
target_include_directories (warabi-c-error PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories (warabi-c-error BEFORE PUBLIC
Expand All @@ -75,6 +78,7 @@ set_target_properties (warabi-c-error

# C client library
add_library (warabi-c-client ${CMAKE_CURRENT_SOURCE_DIR}/c/client.cpp)
add_library (warabi::c-client ALIAS warabi-c-client)
target_link_libraries (warabi-c-client PUBLIC warabi-c-error PRIVATE warabi-client coverage_config)
target_include_directories (warabi-c-client PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories (warabi-c-client BEFORE PUBLIC
Expand All @@ -87,6 +91,7 @@ set_target_properties (warabi-c-client

# C server library
add_library (warabi-c-server ${CMAKE_CURRENT_SOURCE_DIR}/c/server.cpp)
add_library (warabi::c-server ALIAS warabi-c-server)
target_link_libraries (warabi-c-server PUBLIC warabi-c-error PRIVATE warabi-server coverage_config)
target_include_directories (warabi-c-server PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories (warabi-c-server BEFORE PUBLIC
Expand All @@ -100,7 +105,7 @@ set_target_properties (warabi-c-server
if (${ENABLE_BEDROCK})
# bedrock module library
add_library (warabi-bedrock-module ${module-src-files})
target_link_libraries (warabi-bedrock-module warabi-server warabi-client bedrock-server coverage_config)
target_link_libraries (warabi-bedrock-module warabi-server warabi-client bedrock::module-api coverage_config)
target_include_directories (warabi-bedrock-module PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories (warabi-bedrock-module BEFORE PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>)
Expand Down
6 changes: 6 additions & 0 deletions src/warabi-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ pkg_check_modules (uuid REQUIRED uuid)
find_package (nlohmann_json REQUIRED)

include ("${CMAKE_CURRENT_LIST_DIR}/warabi-targets.cmake")

add_library (warabi::client ALIAS warabi-client)
add_library (warabi::server ALIAS warabi-server)
add_library (warabi::c-client ALIAS warabi-c-client)
add_library (warabi::c-server ALIAS warabi-c-server)
add_library (warabi::c-error ALIAS warabi-c-error)
2 changes: 1 addition & 1 deletion tests/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spack:
- pmdk
- fmt
- tclap
- mochi-bedrock+abtio+ssg ^mpich
- mochi-bedrock-module-api
- mercury~boostsys~checksum ^libfabric fabrics=tcp,rxm
- mochi-remi
concretizer:
Expand Down

0 comments on commit b7bfc09

Please sign in to comment.