Compare commits

...

11 Commits

Author SHA1 Message Date
Comix 9f6fc4f376
refactor: make Signal to be type alias of std::string (#80)
std::string is not designed to be inherited form.
The destructor of std::string isn't virtual.

Signed-off-by: ComixHe <ComixHe1895@outlook.com>
2025-02-11 21:04:09 +08:00
black-desk dcef24b3e7
ci: use alls-green
Signed-off-by: black-desk <me@black-desk.cn>
2024-08-22 17:01:27 +08:00
black-desk fa10aa531f
docs: update README
Signed-off-by: black-desk <me@black-desk.cn>
2024-08-22 16:54:15 +08:00
black-desk 3089f45fef
docs: update README
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-15 13:39:02 +08:00
black-desk 578d53fa4b
chore: release 0.3.2
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-08 17:18:29 +08:00
black-desk 012609d414
chore: upgrade cmake scripts
Signed-off-by: black-desk <me@black-desk.cn>
2024-04-08 17:18:26 +08:00
black-desk 76ba54a107
build: upgrade PFL.cmake to v0.5.0-rc.1
To support build with cmake version 3.11.4

Signed-off-by: black-desk <me@black-desk.cn>
2024-04-07 11:53:23 +08:00
dependabot[bot] 7e3c5eac5a
build(deps): bump .format from `8625021` to `95bc22d` (#75)
Bumps [.format](https://github.com/black-desk/.format) from `8625021` to `95bc22d`.
- [Commits](86250216b6...95bc22d2c8)

---
updated-dependencies:
- dependency-name: ".format"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 17:26:08 +08:00
black-desk 1d08ed8fe0
chore: bump version to 0.3.0
Signed-off-by: black-desk <me@black-desk.cn>
2024-03-31 02:38:30 +08:00
black-desk 706d38f353
build: upgrade PFL.cmake to v0.3.0
Signed-off-by: black-desk <me@black-desk.cn>
2024-03-31 02:28:27 +08:00
dependabot[bot] c5270705ee
build(deps): bump jwlawson/actions-setup-cmake from 1.14 to 2.0 (#71) 2024-03-26 06:58:52 +08:00
14 changed files with 1181 additions and 630 deletions

@ -1 +1 @@
Subproject commit 86250216b60370fa08310d80fb8d4ef3d9b674f0
Subproject commit 95bc22d2c878c40eb8800781483ec8aafc2d9f86

View File

@ -36,7 +36,7 @@ jobs:
path: .cache/cpm/source
key: ${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.14
uses: jwlawson/actions-setup-cmake@v2.0
- name: Install system dependencies
run: |
apt update &&
@ -65,8 +65,13 @@ jobs:
cmake --workflow --preset ci
pass:
name: Pass
needs: [checks, build-and-test]
if: always()
needs:
- checks
- build-and-test
runs-on: ubuntu-latest
steps:
- name: Placeholder
run: true
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

View File

@ -1,65 +1,77 @@
cmake_minimum_required(VERSION 3.14..3.28.3)
cmake_minimum_required(VERSION 3.11.4)
project(
ocppi
LANGUAGES CXX
VERSION 0.2.3)
option(OCPPI_BUILD_EXAMPLES "Build examples of ocppi or not"
${PROJECT_IS_TOP_LEVEL})
option(OCPPI_ENABLE_TESTING "Enable test of ocppi or not"
${PROJECT_IS_TOP_LEVEL})
option(OCPPI_BUILD_SHARED_LIBRARY "Build a shared library or not"
${PROJECT_IS_TOP_LEVEL})
option(OCPPI_INSTALL "Enable install target or not" ${PROJECT_IS_TOP_LEVEL})
VERSION 0.3.2)
option(OCPPI_WITH_SPDLOG "Build ocppi with spdlog or not." OFF)
include(./cmake/CPM.cmake)
set(OCPPI_TL_EXPECTED_VERSION 1.0.0) # debian buster-backports
list(APPEND OCPPI_DEPENDENCIES PUBLIC
"tl-expected ${OCPPI_TL_EXPECTED_VERSION} REQUIRED")
list(APPEND OCPPI_LINK_LIBRARIES PUBLIC "tl::expected")
set(OCPPI_JSON_VERSION 3.5.0) # debian buster
list(APPEND OCPPI_DEPENDENCIES PUBLIC
"nlohmann_json ${OCPPI_JSON_VERSION} REQUIRED")
list(APPEND OCPPI_LINK_LIBRARIES PUBLIC "nlohmann_json::nlohmann_json")
if(OCPPI_WITH_SPDLOG)
set(OCPPI_SPDLOG_VERSION 1.3.1) # debian buster
list(APPEND OCPPI_COMPILE_OPTIONS PUBLIC -DOCPPI_WITH_SPDLOG)
list(APPEND OCPPI_LINK_LIBRARIES PUBLIC "spdlog::spdlog")
endif()
if(CMAKE_VERSION LESS 3.14)
message("CPM.cmake disabled")
else()
include(./cmake/CPM.cmake)
CPMFindPackage(
NAME tl-expected
VERSION "${OCPPI_TL_EXPECTED_VERSION}"
GITHUB_REPOSITORY TartanLlama/expected
GIT_TAG "v1.1.0"
GIT_SHALLOW ON
OPTIONS "EXPECTED_BUILD_TESTS OFF"
EXCLUDE_FROM_ALL ON)
CPMFindPackage(
NAME nlohmann_json
VERSION "${OCPPI_JSON_VERSION}"
URL "https://github.com/nlohmann/json/archive/refs/tags/v3.5.0.tar.gz"
EXCLUDE_FROM_ALL ON)
if(OCPPI_WITH_SPDLOG)
CPMFindPackage(
NAME spdlog
VERSION ${OCPPI_SPDLOG_VERSION}
GITHUB_REPOSITORY "gabime/spdlog"
GIT_TAG "v1.3.1"
GIT_SHALLOW ON
EXCLUDE_FROM_ALL ON
OPTIONS
"CMAKE_POSITION_INDEPENDENT_CODE ON" # NOTE:
# https://github.com/gabime/spdlog/issues/1190
)
endif()
endif()
find_package(
tl-expected ${OCPPI_TL_EXPECTED_VERSION} REQUIRED)
set(OCPPI_TL_EXPECTED_MINIMAL_VERSION 1.0.0)
CPMFindPackage(
NAME expected
VERSION "${OCPPI_TL_EXPECTED_MINIMAL_VERSION}"
GITHUB_REPOSITORY TartanLlama/expected
GIT_TAG v1.1.0
GIT_SHALLOW ON
OPTIONS "EXPECTED_BUILD_TESTS OFF"
FIND_PACKAGE_ARGUMENTS "NAMES tl-expected"
EXCLUDE_FROM_ALL ON)
if(NOT TARGET tl::expected)
# NOTE: v1.0.0 version of tl::expected doesn't have a namespaced alias so we
# have to add it here.
# NOTE: v1.0.0 version of tl::expected doesn't have a namespaced alias when
# using with add_subdirectory so we have to add it here.
add_library(tl::expected ALIAS expected)
endif()
list(APPEND OCPPI_LINK_LIBRARIES PUBLIC tl::expected)
set(OCPPI_JSON_MINIMAL_VERSION 3.5.0) # debian buster
CPMFindPackage(
NAME nlohmann_json
VERSION "${OCPPI_JSON_MINIMAL_VERSION}"
URL "https://github.com/nlohmann/json/archive/refs/tags/v3.5.0.tar.gz"
EXCLUDE_FROM_ALL ON)
list(APPEND OCPPI_LINK_LIBRARIES PUBLIC nlohmann_json::nlohmann_json)
find_package(
nlohmann_json ${OCPPI_JSON_VERSION} QUIET)
set(OCPPI_SPDLOG_MINIMAL_VERSION 1.3.1) # debian buster
if(OCPPI_WITH_SPDLOG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOCPPI_WITH_SPDLOG")
CPMFindPackage(
NAME spdlog
VERSION ${OCPPI_SPDLOG_MINIMAL_VERSION}
GITHUB_REPOSITORY "gabime/spdlog"
GIT_TAG "v1.3.1"
GIT_SHALLOW ON
EXCLUDE_FROM_ALL ON
OPTIONS
"CMAKE_POSITION_INDEPENDENT_CODE ON" # NOTE:
# https://github.com/gabime/spdlog/issues/1190
)
list(APPEND OCPPI_LINK_LIBRARIES PRIVATE spdlog::spdlog)
if(NOT nlohmann_json_FOUND)
# NOTE: v3.5.0 version of nlohmann_json doesn't have a cmake config file in
# debian, so we have to fix this manually.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake.fix)
find_package(nlohmann_json ${OCPPI_JSON_VERSION} REQUIRED)
endif()
include(./cmake/GitSemver.cmake)
@ -73,166 +85,163 @@ set(OCPPI_LIBRARY_TYPE "STATIC")
if(OCPPI_BUILD_SHARED_LIBRARY)
set(OCPPI_LIBRARY_TYPE "SHARED")
endif()
set(OCPPI_SOVERSION 0)
include(./cmake/PFL.cmake)
pfl_init(ENABLE_TESTING ${OCPPI_ENABLE_TESTING} BUILD_EXAMPLES
${OCPPI_BUILD_EXAMPLES} INSTALL ${OCPPI_INSTALL})
pfl_init(AUTO)
pfl_add_library(
SOVERSION
${OCPPI_SOVERSION}
VERSION
${PROJECT_VERSION}
TYPE
${OCPPI_LIBRARY_TYPE}
INS
include/ocppi/configure.hpp.in
include/ocppi/runtime/configure.hpp.in
SOURCES
# find -regex '\.\/src\/.*\.\(h\|c\)pp' | sort
./src/ocppi/cli/CLI.cpp
./src/ocppi/cli/CommandFailedError.cpp
./src/ocppi/cli/CommonCLI.cpp
./src/ocppi/cli/crun/Crun.cpp
./src/ocppi/cli/ExecutableNotFoundError.cpp
./src/ocppi/cli/Process.cpp
./src/ocppi/cli/Process.hpp
./src/ocppi/cli/runc/Runc.cpp
./src/ocppi/cli/youki/Youki.cpp
./src/ocppi/configure.cpp
./src/ocppi/InvalidArgumentError.cpp
./src/ocppi/runtime/configure.cpp
./src/ocppi/runtime/ContainerID.cpp
./src/ocppi/runtime/CreateOption.cpp
./src/ocppi/runtime/DeleteOption.cpp
./src/ocppi/runtime/FeaturesOption.cpp
./src/ocppi/runtime/GlobalOption.cpp
./src/ocppi/runtime/KillOption.cpp
./src/ocppi/runtime/RunOption.cpp
./src/ocppi/runtime/Runtime.cpp
./src/ocppi/runtime/Signal.cpp
./src/ocppi/runtime/StartOption.cpp
./src/ocppi/runtime/StateOption.cpp
HEADERS
# find -regex '\.\/include\/.*\.hpp' | sort
./include/ocppi/cli/CLI.hpp
./include/ocppi/cli/CommandFailedError.hpp
./include/ocppi/cli/CommonCLI.hpp
./include/ocppi/cli/crun/Crun.hpp
./include/ocppi/cli/ExecutableNotFoundError.hpp
./include/ocppi/cli/runc/Runc.hpp
./include/ocppi/cli/youki/Youki.hpp
./include/ocppi/InvalidArgumentError.hpp
./include/ocppi/runtime/config/types/Anet.hpp
./include/ocppi/runtime/config/types/BlockIODeviceThrottle.hpp
./include/ocppi/runtime/config/types/BlockIODeviceWeight.hpp
./include/ocppi/runtime/config/types/BlockIO.hpp
./include/ocppi/runtime/config/types/BoottimeClass.hpp
./include/ocppi/runtime/config/types/Capabilities.hpp
./include/ocppi/runtime/config/types/CappedCPU.hpp
./include/ocppi/runtime/config/types/CappedMemory.hpp
./include/ocppi/runtime/config/types/Class.hpp
./include/ocppi/runtime/config/types/Config.hpp
./include/ocppi/runtime/config/types/ConsoleSize.hpp
./include/ocppi/runtime/config/types/DeviceCgroup.hpp
./include/ocppi/runtime/config/types/FluffyCPU.hpp
./include/ocppi/runtime/config/types/FluffyMemory.hpp
./include/ocppi/runtime/config/types/Generators.hpp
./include/ocppi/runtime/config/types/helper.hpp
./include/ocppi/runtime/config/types/Hook.hpp
./include/ocppi/runtime/config/types/Hooks.hpp
./include/ocppi/runtime/config/types/HugepageLimit.hpp
./include/ocppi/runtime/config/types/Hyperv.hpp
./include/ocppi/runtime/config/types/Hypervisor.hpp
./include/ocppi/runtime/config/types/IdMapping.hpp
./include/ocppi/runtime/config/types/IdType.hpp
./include/ocppi/runtime/config/types/Image.hpp
./include/ocppi/runtime/config/types/IntelRdt.hpp
./include/ocppi/runtime/config/types/IoPriority.hpp
./include/ocppi/runtime/config/types/Kernel.hpp
./include/ocppi/runtime/config/types/LinuxDevice.hpp
./include/ocppi/runtime/config/types/Linux.hpp
./include/ocppi/runtime/config/types/LinuxResources.hpp
./include/ocppi/runtime/config/types/Mount.hpp
./include/ocppi/runtime/config/types/NamespaceReference.hpp
./include/ocppi/runtime/config/types/NamespaceType.hpp
./include/ocppi/runtime/config/types/NetworkInterfacePriority.hpp
./include/ocppi/runtime/config/types/PersonalityDomain.hpp
./include/ocppi/runtime/config/types/Personality.hpp
./include/ocppi/runtime/config/types/Pids.hpp
./include/ocppi/runtime/config/types/Process.hpp
./include/ocppi/runtime/config/types/PurpleCPU.hpp
./include/ocppi/runtime/config/types/PurpleMemory.hpp
./include/ocppi/runtime/config/types/Rdma.hpp
./include/ocppi/runtime/config/types/ResourcesNetwork.hpp
./include/ocppi/runtime/config/types/Rlimit.hpp
./include/ocppi/runtime/config/types/RootfsPropagation.hpp
./include/ocppi/runtime/config/types/Root.hpp
./include/ocppi/runtime/config/types/RootImageFormat.hpp
./include/ocppi/runtime/config/types/SchedulerFlag.hpp
./include/ocppi/runtime/config/types/Scheduler.hpp
./include/ocppi/runtime/config/types/SchedulerPolicy.hpp
./include/ocppi/runtime/config/types/SeccompAction.hpp
./include/ocppi/runtime/config/types/SeccompArch.hpp
./include/ocppi/runtime/config/types/SeccompFlag.hpp
./include/ocppi/runtime/config/types/Seccomp.hpp
./include/ocppi/runtime/config/types/SeccompOperators.hpp
./include/ocppi/runtime/config/types/Solaris.hpp
./include/ocppi/runtime/config/types/Storage.hpp
./include/ocppi/runtime/config/types/SyscallArg.hpp
./include/ocppi/runtime/config/types/Syscall.hpp
./include/ocppi/runtime/config/types/TimeOffsets.hpp
./include/ocppi/runtime/config/types/User.hpp
./include/ocppi/runtime/config/types/Vm.hpp
./include/ocppi/runtime/config/types/WindowsDevice.hpp
./include/ocppi/runtime/config/types/Windows.hpp
./include/ocppi/runtime/config/types/WindowsNetwork.hpp
./include/ocppi/runtime/config/types/WindowsResources.hpp
./include/ocppi/runtime/config/types/ZosDevice.hpp
./include/ocppi/runtime/config/types/Zos.hpp
./include/ocppi/runtime/ContainerID.hpp
./include/ocppi/runtime/CreateOption.hpp
./include/ocppi/runtime/DeleteOption.hpp
./include/ocppi/runtime/ExecOption.hpp
./include/ocppi/runtime/FeaturesOption.hpp
./include/ocppi/runtime/features/types/Apparmor.hpp
./include/ocppi/runtime/features/types/Cgroup.hpp
./include/ocppi/runtime/features/types/Features.hpp
./include/ocppi/runtime/features/types/Generators.hpp
./include/ocppi/runtime/features/types/helper.hpp
./include/ocppi/runtime/features/types/IntelRdt.hpp
./include/ocppi/runtime/features/types/Linux.hpp
./include/ocppi/runtime/features/types/NamespaceType.hpp
./include/ocppi/runtime/features/types/SeccompAction.hpp
./include/ocppi/runtime/features/types/SeccompArch.hpp
./include/ocppi/runtime/features/types/SeccompFlag.hpp
./include/ocppi/runtime/features/types/Seccomp.hpp
./include/ocppi/runtime/features/types/SeccompOperators.hpp
./include/ocppi/runtime/features/types/Selinux.hpp
./include/ocppi/runtime/GlobalOption.hpp
./include/ocppi/runtime/KillOption.hpp
./include/ocppi/runtime/ListOption.hpp
./include/ocppi/runtime/RunOption.hpp
./include/ocppi/runtime/Runtime.hpp
./include/ocppi/runtime/Signal.hpp
./include/ocppi/runtime/SpecRuntime.hpp
./include/ocppi/runtime/StartOption.hpp
./include/ocppi/runtime/StateOption.hpp
./include/ocppi/runtime/state/types/Generators.hpp
./include/ocppi/runtime/state/types/helper.hpp
./include/ocppi/runtime/state/types/State.hpp
./include/ocppi/runtime/state/types/Status.hpp
./include/ocppi/types/ContainerListItem.hpp
./include/ocppi/types/Generators.hpp
./include/ocppi/types/helper.hpp
OUTPUT_NAME
ocppi
EXAMPLES
parse-config
using-crun
with-logger
LINK_LIBRARIES
${OCPPI_LINK_LIBRARIES}
PUBLIC
stdc++fs
COMPILE_FEATURES
PUBLIC
cxx_std_17)
cxx_std_17
COMPILE_OPTIONS
${OCPPI_COMPILE_OPTIONS}
DEPENDENCIES
${OCPPI_DEPENDENCIES}
SOURCES
# find -regex '\./src/.+\.[ch]\(pp\)?(\.in)?' -type f -printf '%P\n'| sort
include/ocppi/cli/CLI.hpp
include/ocppi/cli/CommandFailedError.hpp
include/ocppi/cli/CommonCLI.hpp
include/ocppi/cli/crun/Crun.hpp
include/ocppi/cli/ExecutableNotFoundError.hpp
include/ocppi/cli/runc/Runc.hpp
include/ocppi/cli/youki/Youki.hpp
include/ocppi/configure.hpp.in
include/ocppi/InvalidArgumentError.hpp
include/ocppi/runtime/config/types/Anet.hpp
include/ocppi/runtime/config/types/BlockIODeviceThrottle.hpp
include/ocppi/runtime/config/types/BlockIODeviceWeight.hpp
include/ocppi/runtime/config/types/BlockIO.hpp
include/ocppi/runtime/config/types/BoottimeClass.hpp
include/ocppi/runtime/config/types/Capabilities.hpp
include/ocppi/runtime/config/types/CappedCPU.hpp
include/ocppi/runtime/config/types/CappedMemory.hpp
include/ocppi/runtime/config/types/Class.hpp
include/ocppi/runtime/config/types/Config.hpp
include/ocppi/runtime/config/types/ConsoleSize.hpp
include/ocppi/runtime/config/types/DeviceCgroup.hpp
include/ocppi/runtime/config/types/FluffyCPU.hpp
include/ocppi/runtime/config/types/FluffyMemory.hpp
include/ocppi/runtime/config/types/Generators.hpp
include/ocppi/runtime/config/types/helper.hpp
include/ocppi/runtime/config/types/Hook.hpp
include/ocppi/runtime/config/types/Hooks.hpp
include/ocppi/runtime/config/types/HugepageLimit.hpp
include/ocppi/runtime/config/types/Hyperv.hpp
include/ocppi/runtime/config/types/Hypervisor.hpp
include/ocppi/runtime/config/types/IdMapping.hpp
include/ocppi/runtime/config/types/IdType.hpp
include/ocppi/runtime/config/types/Image.hpp
include/ocppi/runtime/config/types/IntelRdt.hpp
include/ocppi/runtime/config/types/IoPriority.hpp
include/ocppi/runtime/config/types/Kernel.hpp
include/ocppi/runtime/config/types/LinuxDevice.hpp
include/ocppi/runtime/config/types/Linux.hpp
include/ocppi/runtime/config/types/LinuxResources.hpp
include/ocppi/runtime/config/types/Mount.hpp
include/ocppi/runtime/config/types/NamespaceReference.hpp
include/ocppi/runtime/config/types/NamespaceType.hpp
include/ocppi/runtime/config/types/NetworkInterfacePriority.hpp
include/ocppi/runtime/config/types/PersonalityDomain.hpp
include/ocppi/runtime/config/types/Personality.hpp
include/ocppi/runtime/config/types/Pids.hpp
include/ocppi/runtime/config/types/Process.hpp
include/ocppi/runtime/config/types/PurpleCPU.hpp
include/ocppi/runtime/config/types/PurpleMemory.hpp
include/ocppi/runtime/config/types/Rdma.hpp
include/ocppi/runtime/config/types/ResourcesNetwork.hpp
include/ocppi/runtime/config/types/Rlimit.hpp
include/ocppi/runtime/config/types/RootfsPropagation.hpp
include/ocppi/runtime/config/types/Root.hpp
include/ocppi/runtime/config/types/RootImageFormat.hpp
include/ocppi/runtime/config/types/SchedulerFlag.hpp
include/ocppi/runtime/config/types/Scheduler.hpp
include/ocppi/runtime/config/types/SchedulerPolicy.hpp
include/ocppi/runtime/config/types/SeccompAction.hpp
include/ocppi/runtime/config/types/SeccompArch.hpp
include/ocppi/runtime/config/types/SeccompFlag.hpp
include/ocppi/runtime/config/types/Seccomp.hpp
include/ocppi/runtime/config/types/SeccompOperators.hpp
include/ocppi/runtime/config/types/Solaris.hpp
include/ocppi/runtime/config/types/Storage.hpp
include/ocppi/runtime/config/types/SyscallArg.hpp
include/ocppi/runtime/config/types/Syscall.hpp
include/ocppi/runtime/config/types/TimeOffsets.hpp
include/ocppi/runtime/config/types/User.hpp
include/ocppi/runtime/config/types/Vm.hpp
include/ocppi/runtime/config/types/WindowsDevice.hpp
include/ocppi/runtime/config/types/Windows.hpp
include/ocppi/runtime/config/types/WindowsNetwork.hpp
include/ocppi/runtime/config/types/WindowsResources.hpp
include/ocppi/runtime/config/types/ZosDevice.hpp
include/ocppi/runtime/config/types/Zos.hpp
include/ocppi/runtime/configure.hpp.in
include/ocppi/runtime/ContainerID.hpp
include/ocppi/runtime/CreateOption.hpp
include/ocppi/runtime/DeleteOption.hpp
include/ocppi/runtime/ExecOption.hpp
include/ocppi/runtime/FeaturesOption.hpp
include/ocppi/runtime/features/types/Apparmor.hpp
include/ocppi/runtime/features/types/Cgroup.hpp
include/ocppi/runtime/features/types/Features.hpp
include/ocppi/runtime/features/types/Generators.hpp
include/ocppi/runtime/features/types/helper.hpp
include/ocppi/runtime/features/types/IntelRdt.hpp
include/ocppi/runtime/features/types/Linux.hpp
include/ocppi/runtime/features/types/NamespaceType.hpp
include/ocppi/runtime/features/types/SeccompAction.hpp
include/ocppi/runtime/features/types/SeccompArch.hpp
include/ocppi/runtime/features/types/SeccompFlag.hpp
include/ocppi/runtime/features/types/Seccomp.hpp
include/ocppi/runtime/features/types/SeccompOperators.hpp
include/ocppi/runtime/features/types/Selinux.hpp
include/ocppi/runtime/GlobalOption.hpp
include/ocppi/runtime/KillOption.hpp
include/ocppi/runtime/ListOption.hpp
include/ocppi/runtime/RunOption.hpp
include/ocppi/runtime/Runtime.hpp
include/ocppi/runtime/Signal.hpp
include/ocppi/runtime/SpecRuntime.hpp
include/ocppi/runtime/StartOption.hpp
include/ocppi/runtime/StateOption.hpp
include/ocppi/runtime/state/types/Generators.hpp
include/ocppi/runtime/state/types/helper.hpp
include/ocppi/runtime/state/types/State.hpp
include/ocppi/runtime/state/types/Status.hpp
include/ocppi/types/ContainerListItem.hpp
include/ocppi/types/Generators.hpp
include/ocppi/types/helper.hpp
src/ocppi/cli/CLI.cpp
src/ocppi/cli/CommandFailedError.cpp
src/ocppi/cli/CommonCLI.cpp
src/ocppi/cli/crun/Crun.cpp
src/ocppi/cli/ExecutableNotFoundError.cpp
src/ocppi/cli/Process.cpp
src/ocppi/cli/Process.hpp
src/ocppi/cli/runc/Runc.cpp
src/ocppi/cli/youki/Youki.cpp
src/ocppi/configure.cpp
src/ocppi/InvalidArgumentError.cpp
src/ocppi/runtime/configure.cpp
src/ocppi/runtime/ContainerID.cpp
src/ocppi/runtime/CreateOption.cpp
src/ocppi/runtime/DeleteOption.cpp
src/ocppi/runtime/FeaturesOption.cpp
src/ocppi/runtime/GlobalOption.cpp
src/ocppi/runtime/KillOption.cpp
src/ocppi/runtime/RunOption.cpp
src/ocppi/runtime/Runtime.cpp
src/ocppi/runtime/Signal.cpp
src/ocppi/runtime/StartOption.cpp
src/ocppi/runtime/StateOption.cpp)

View File

@ -0,0 +1,13 @@
try_compile(
nlohmann_json_FOUND ${CMAKE_CURRENT_BINARY_DIR}/nlohmann_json_compile_test
${CMAKE_CURRENT_LIST_DIR}/nlohmann_json_compile_test.cpp)
if(NOT nlohmann_json_FOUND)
return()
endif()
if(NOT TARGET nlohmann_json::nlohmann_json)
add_library(nlohmann_json INTERFACE)
add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json)
install(TARGETS nlohmann_json EXPORT "${PROJECT_NAME}")
endif()

View File

@ -0,0 +1,18 @@
#include "nlohmann/json.hpp"
// NOTE: This cpp file is used by Findnlohmann_json.cmake to check
// whether the nlohmann_json library we founded at include directory
// is compatible with 3.5.0 or not.
#if NLOHMANN_JSON_VERSION_MAJOR != 3
#error require nlohmann_json compatible with 3.5.0
#endif
#if NLOHMANN_JSON_VERSION_MINOR < 5
#error require nlohmann_json compatible with 3.5.0
#endif
int main()
{
return 0;
}

View File

@ -42,7 +42,7 @@ if(NOT COMMAND cpm_message)
endfunction()
endif()
set(CURRENT_CPM_VERSION 0.38.7)
set(CURRENT_CPM_VERSION 0.38.8)
get_filename_component(CPM_CURRENT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
if(CPM_DIRECTORY)
@ -300,12 +300,6 @@ function(CPMFindPackage)
return()
endif()
cpm_check_if_package_already_added(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}")
if(CPM_PACKAGE_ALREADY_ADDED)
cpm_export_variables(${CPM_ARGS_NAME})
return()
endif()
cpm_find_package(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}" ${CPM_ARGS_FIND_PACKAGE_ARGUMENTS})
if(NOT CPM_PACKAGE_FOUND)

View File

@ -16,11 +16,24 @@ function(gitsemver_message)
message(STATUS "GitSemver: " ${ARGN})
endfunction()
message(STATUS "GitSemver: --==Version: v0.1.2==--")
message(STATUS "GitSemver: --==Version: v0.1.4==--")
# GitSemver will write the result to varname if it successfully get version
# string from git repository.
function(GitSemver varname)
if(CMAKE_VERSION VERSION_LESS 3.21)
# https://www.scivision.dev/cmake-project-is-top-level/
get_property(
not_top
DIRECTORY
PROPERTY PARENT_DIRECTORY)
if(NOT not_top)
set(PROJECT_IS_TOP_LEVEL true)
else()
set(PROJECT_IS_TOP_LEVEL false)
endif()
endif()
if(NOT PROJECT_IS_TOP_LEVEL)
return()
endif()
@ -45,7 +58,7 @@ function(GitSemver varname)
COMMAND ${SED_EXECUTABLE} -e s/^v//
COMMAND ${SED_EXECUTABLE} -e s/+\$//
OUTPUT_VARIABLE ${varname} RESULTS_VARIABLE rets
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET COMMAND_ECHO STDOUT)
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
foreach(ret ${rets})
if(NOT ret EQUAL 0)

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,9 @@
pfl_add_executable(INTERNAL SOURCES ./src/main.cpp LINK_LIBRARIES PUBLIC
ocppi::ocppi)
pfl_add_executable(
OUTPUT_NAME
parse-config
DISABLE_INSTALL
SOURCES
./src/main.cpp
LINK_LIBRARIES
PUBLIC
ocppi::ocppi)

View File

@ -4,5 +4,11 @@ if(OCPPI_WITH_SPDLOG)
list(APPEND LINK_LIBRARIES PRIVATE spdlog::spdlog)
endif()
pfl_add_executable(INTERNAL SOURCES src/main.cpp LINK_LIBRARIES
${LINK_LIBRARIES})
pfl_add_executable(
OUTPUT_NAME
using-crun
DISABLE_INSTALL
SOURCES
src/main.cpp
LINK_LIBRARIES
${LINK_LIBRARIES})

View File

@ -3,7 +3,9 @@ if(NOT OCPPI_WITH_SPDLOG)
endif()
pfl_add_executable(
INTERNAL
OUTPUT_NAME
with-logger
DISABLE_INSTALL
SOURCES
src/main.cpp
LINK_LIBRARIES

View File

@ -31,7 +31,6 @@ struct DeleteOption;
struct ExecOption;
struct KillOption;
struct ListOption;
class Signal;
struct StartOption;
struct StateOption;
struct GlobalOption;

View File

@ -2,11 +2,7 @@
#include <string>
namespace ocppi::runtime
{
class Signal : public std::string {
using std::string::string;
};
namespace ocppi::runtime {
using Signal = std::string;
}

View File

@ -10,6 +10,7 @@
#include "ocppi/runtime/DeleteOption.hpp"
#include "ocppi/runtime/FeaturesOption.hpp"
#include "ocppi/runtime/KillOption.hpp"
#include "ocppi/runtime/Signal.hpp"
#include "ocppi/runtime/StartOption.hpp"
#include "ocppi/runtime/StateOption.hpp"
#include "ocppi/runtime/features/types/Features.hpp"
@ -24,8 +25,6 @@ namespace state::types
struct State;
}
class Signal;
class SpecRuntime {
public:
SpecRuntime() = default;