Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ jobs:
- name: Detect Conan Profile
run: conan profile detect -f

- name: Bootstrap local Corrade recipe
run: conan create ${{github.workspace}}/recipes/corrade/all --version cci.20250327 --build=missing

- name: Bootstrap local pcapplusplus recipe
run: conan create ${{github.workspace}}/recipes/pcapplusplus/cmake --version 23.09 --build=missing

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCONAN_INSTALL_ARGS="--build=missing;-c=corrade/*:tools.build:cxxflags=['-include','vector']"
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCONAN_INSTALL_ARGS="--build=missing"

- name: Build
working-directory: ${{github.workspace}}/build
Expand Down Expand Up @@ -86,6 +92,9 @@ jobs:
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
restore-keys: conan-${{ runner.os }}-amd64-

- name: Bootstrap local Corrade recipe
run: conan create ${{github.workspace}}/recipes/corrade/all --version cci.20250327 --build=missing

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
restore-keys: conan-${{ runner.os }}-

- name: Bootstrap local Corrade recipe
run: conan create ${{github.workspace}}/recipes/corrade/all --version cci.20250327 --build=missing

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ jobs:
key: conan-${{ runner.os }}-${{matrix.arch}}-${{ hashFiles('**/conanfile.py') }}
restore-keys: conan-${{ runner.os }}-${{matrix.arch}}-

- name: Bootstrap local Corrade recipe
working-directory: ${{github.workspace}}/src
run: conan create recipes/corrade/all --version cci.20250327 -pr:b=default --build=missing

- name: Install dependencies
working-directory: ${{github.workspace}}/src
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
restore-keys: conan-${{ runner.os }}-amd64-

- name: Bootstrap local Corrade recipe
run: conan create ${{github.workspace}}/recipes/corrade/all --version cci.20250327 --build=missing

- name: linux package install
run: |
sudo apt-get update
Expand Down
78 changes: 56 additions & 22 deletions cmake/conan_provider.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,14 @@ function(detect_arch arch)
endfunction()


function(detect_cxx_standard cxx_standard)
function(detect_cxx_standard compiler cxx_standard)
set(${cxx_standard} ${CMAKE_CXX_STANDARD} PARENT_SCOPE)
if(CMAKE_CXX_EXTENSIONS)
set(${cxx_standard} "gnu${CMAKE_CXX_STANDARD}" PARENT_SCOPE)
if(compiler STREQUAL "msvc")
set(${cxx_standard} "${CMAKE_CXX_STANDARD}" PARENT_SCOPE)
else()
set(${cxx_standard} "gnu${CMAKE_CXX_STANDARD}" PARENT_SCOPE)
endif()
endif()
endfunction()

Expand Down Expand Up @@ -356,8 +360,10 @@ macro(append_compiler_executables_configuration)
# Not necessary to warn if RC not defined
endif()
if(NOT "x${_conan_compilers_list}" STREQUAL "x")
string(REPLACE ";" "," _conan_compilers_list "${_conan_compilers_list}")
string(APPEND profile "tools.build:compiler_executables={${_conan_compilers_list}}\n")
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
string(REPLACE ";" "," _conan_compilers_list "${_conan_compilers_list}")
string(APPEND profile "tools.build:compiler_executables={${_conan_compilers_list}}\n")
endif()
endif()
unset(_conan_c_compiler)
unset(_conan_cpp_compiler)
Expand All @@ -370,7 +376,7 @@ function(detect_host_profile output_file)
detect_os(os os_api_level os_sdk os_subsystem os_version)
detect_arch(arch)
detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type)
detect_cxx_standard(compiler_cppstd)
detect_cxx_standard(${compiler} compiler_cppstd)
detect_lib_cxx(compiler_libcxx)
detect_build_type(build_type)

Expand Down Expand Up @@ -461,10 +467,9 @@ endfunction()


function(conan_install)
cmake_parse_arguments(ARGS conan_args ${ARGN})
set(conan_output_folder ${CMAKE_BINARY_DIR}/conan)
# Invoke "conan install" with the provided arguments
set(conan_args ${conan_args} -of=${conan_output_folder})
set(conan_args -of=${conan_output_folder})
message(STATUS "CMake-Conan: conan install ${CMAKE_SOURCE_DIR} ${conan_args} ${ARGN}")


Expand Down Expand Up @@ -567,7 +572,7 @@ macro(conan_provide_dependency method package_name)
get_property(_conan_install_success GLOBAL PROPERTY CONAN_INSTALL_SUCCESS)
if(NOT _conan_install_success)
find_program(CONAN_COMMAND "conan" REQUIRED)
conan_get_version(${CONAN_COMMAND} CONAN_CURRENT_VERSION)
conan_get_version("${CONAN_COMMAND}" CONAN_CURRENT_VERSION)
conan_version_check(MINIMUM ${CONAN_MINIMUM_VERSION} CURRENT ${CONAN_CURRENT_VERSION})
message(STATUS "CMake-Conan: first find_package() found. Installing dependencies with Conan")
if("default" IN_LIST CONAN_HOST_PROFILE OR "default" IN_LIST CONAN_BUILD_PROFILE)
Expand All @@ -580,30 +585,59 @@ macro(conan_provide_dependency method package_name)
construct_profile_argument(_build_profile_flags CONAN_BUILD_PROFILE)
if(EXISTS "${CMAKE_SOURCE_DIR}/conanfile.py")
file(READ "${CMAKE_SOURCE_DIR}/conanfile.py" outfile)
if(NOT "${outfile}" MATCHES ".*CMakeDeps.*")
message(WARNING "Cmake-conan: CMakeDeps generator was not defined in the conanfile")
if(NOT "${outfile}" MATCHES ".*CMakeConfigDeps.*")
message(WARNING "Cmake-conan: CMakeConfigDeps generator was not defined in the conanfile")
endif()
set(generator "")
elseif (EXISTS "${CMAKE_SOURCE_DIR}/conanfile.txt")
file(READ "${CMAKE_SOURCE_DIR}/conanfile.txt" outfile)
if(NOT "${outfile}" MATCHES ".*CMakeDeps.*")
message(WARNING "Cmake-conan: CMakeDeps generator was not defined in the conanfile. "
"Please define the generator as it will be mandatory in the future")
if(NOT "${outfile}" MATCHES ".*CMakeConfigDeps.*")
message(WARNING "Cmake-conan: CMakeConfigDeps generator was not defined in the conanfile")
endif()
set(generator "-g;CMakeDeps")
endif()

get_property(_multiconfig_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT _multiconfig_generator)
message(STATUS "CMake-Conan: Installing single configuration ${CMAKE_BUILD_TYPE}")
conan_install(${_host_profile_flags} ${_build_profile_flags} ${CONAN_INSTALL_ARGS} ${generator})

if(DEFINED CONAN_INSTALL_BUILD_CONFIGURATIONS)
# Configurations are specified by the project or user
set(_build_configs "${CONAN_INSTALL_BUILD_CONFIGURATIONS}")
list(LENGTH _build_configs _build_configs_length)
if(NOT _multiconfig_generator AND _build_configs_length GREATER 1)
message(FATAL_ERROR "cmake-conan: when using a single-config CMake generator, "
"please only specify a single configuration in CONAN_INSTALL_BUILD_CONFIGURATIONS")
endif()
unset(_build_configs_length)
else()
message(STATUS "CMake-Conan: Installing both Debug and Release")
conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=Release ${CONAN_INSTALL_ARGS} ${generator})
conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=Debug ${CONAN_INSTALL_ARGS} ${generator})
# No configuration overrides, provide sensible defaults
if(_multiconfig_generator)
set(_build_configs Release Debug)
else()
set(_build_configs ${CMAKE_BUILD_TYPE})
endif()

endif()

list(JOIN _build_configs ", " _build_configs_msg)
message(STATUS "CMake-Conan: Installing configuration(s): ${_build_configs_msg}")
foreach(_build_config IN LISTS _build_configs)
set(_self_build_config "")
if(NOT _multiconfig_generator AND NOT _build_config STREQUAL "${CMAKE_BUILD_TYPE}")
set(_self_build_config -s &:build_type=${CMAKE_BUILD_TYPE})
endif()
conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=${_build_config} ${_self_build_config} ${CONAN_INSTALL_ARGS})
endforeach()

get_property(_conan_generators_folder GLOBAL PROPERTY CONAN_GENERATORS_FOLDER)
if(EXISTS "${_conan_generators_folder}/conan_cmakedeps_paths.cmake")
message(STATUS "CMake-Conan: Loading conan_cmakedeps_paths.cmake file")
include(${_conan_generators_folder}/conan_cmakedeps_paths.cmake)
endif()

unset(_self_build_config)
unset(_multiconfig_generator)
unset(_build_configs)
unset(_build_configs_msg)
unset(_host_profile_flags)
unset(_build_profile_flags)
unset(_multiconfig_generator)
unset(_conan_install_success)
else()
message(STATUS "CMake-Conan: find_package(${ARGV1}) found, 'conan install' already ran")
Expand Down
6 changes: 3 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Pktvisor(ConanFile):

def requirements(self):
self.requires("catch2/3.8.0")
self.requires("corrade/2020.06")
self.requires("corrade/cci.20250327")
self.requires("cpp-httplib/0.18.3")
self.requires("docopt.cpp/0.6.3")
self.requires("fast-cpp-csv-parser/cci.20240102")
Expand All @@ -20,7 +20,7 @@ def requirements(self):
self.requires("libpcap/1.10.5", force=True)
else:
self.requires("npcap/1.70")
self.requires("opentelemetry-cpp/1.17.0")
self.requires("opentelemetry-cpp/1.24.0")
self.requires("pcapplusplus/23.09")
self.requires("protobuf/5.27.0")
self.requires("sigslot/1.2.2")
Expand All @@ -37,7 +37,7 @@ def requirements(self):
self.requires("sentry-crashpad/0.6.5")

def build_requirements(self):
self.tool_requires("corrade/2020.06")
self.tool_requires("corrade/cci.20250327")
self.tool_requires("protobuf/5.27.0")

def layout(self):
Expand Down
Loading
Loading