Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 15 additions & 5 deletions .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@ jobs:
uses: actions/cache@v5
with:
path: ${{github.workspace}}/build/p/
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
Comment thread
leoparente marked this conversation as resolved.
Outdated
restore-keys: conan-${{ runner.os }}-

- name: Detect Conan Profile
run: conan profile detect -f

- name: Export local Corrade recipe
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327

- 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 @@ -83,9 +86,12 @@ jobs:
uses: actions/cache@v5
with:
path: ${{github.workspace}}/build/p/
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
Comment thread
leoparente marked this conversation as resolved.
Outdated
restore-keys: conan-${{ runner.os }}-amd64-

- name: Export local Corrade recipe
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
Expand Down Expand Up @@ -131,9 +137,13 @@ jobs:
uses: actions/cache@v5
with:
path: ${{github.workspace}}/build/p/
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
Comment thread
leoparente marked this conversation as resolved.
Outdated
restore-keys: conan-${{ runner.os }}-

- name: Export local Corrade recipe
shell: bash
run: conan export $GITHUB_WORKSPACE/conan/corrade/ --name=corrade --version=cci.20260327

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}\build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ jobs:
uses: actions/cache@v5
with:
path: ${{github.workspace}}/build/p/
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
Comment thread
leoparente marked this conversation as resolved.
Outdated
restore-keys: conan-${{ runner.os }}-

- name: Export local Corrade recipe
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327

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

- name: Export local Corrade recipe
run: conan export ${{github.workspace}}/src/conan/corrade/ --name=corrade --version=cci.20260327

- name: Install dependencies
working-directory: ${{github.workspace}}/src
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ jobs:
uses: actions/cache@v5
with:
path: ${{github.workspace}}/build/p/
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py') }}
key: conan-${{ runner.os }}-amd64-${{ hashFiles('conanfile.py', '*/conanfile.py', 'conan/corrade/conanfile.py') }}
Comment thread
leoparente marked this conversation as resolved.
Outdated
restore-keys: conan-${{ runner.os }}-amd64-

- name: linux package install
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends jq lcov

- name: Export local Corrade recipe
run: conan export ${{github.workspace}}/conan/corrade/ --name=corrade --version=cci.20260327

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
Expand Down
60 changes: 60 additions & 0 deletions conan/corrade/cmake/conan-corrade-vars.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Here we are reproducing the variables and call performed by the FindCorrade.cmake provided by the library

# Read flags from configuration
file(READ "${CMAKE_CURRENT_LIST_DIR}/../../include/Corrade/configure.h" _corradeConfigure)
string(REGEX REPLACE ";" "\\\\;" _corradeConfigure "${_corradeConfigure}")
string(REGEX REPLACE "\n" ";" _corradeConfigure "${_corradeConfigure}")
set(_corradeFlags
MSVC2015_COMPATIBILITY
MSVC2017_COMPATIBILITY
MSVC2019_COMPATIBILITY
BUILD_DEPRECATED
BUILD_STATIC
BUILD_STATIC_UNIQUE_GLOBALS
BUILD_MULTITHREADED
TARGET_UNIX
TARGET_APPLE
TARGET_IOS
TARGET_IOS_SIMULATOR
TARGET_WINDOWS
TARGET_WINDOWS_RT
TARGET_EMSCRIPTEN
TARGET_ANDROID
# TARGET_X86 etc and TARGET_LIBCXX are not exposed to CMake as the meaning
# is unclear on platforms with multi-arch binaries or when mixing different
# STL implementations. TARGET_GCC etc are figured out via UseCorrade.cmake,
# as the compiler can be different when compiling the lib & when using it.
PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
TESTSUITE_TARGET_XCTEST
UTILITY_USE_ANSI_COLORS)
foreach(_corradeFlag ${_corradeFlags})
list(FIND _corradeConfigure "#define CORRADE_${_corradeFlag}" _corrade_${_corradeFlag})
if(NOT _corrade_${_corradeFlag} EQUAL -1)
set(CORRADE_${_corradeFlag} 1)
endif()
endforeach()


# Corrade::rc, a target with just an executable
if(NOT TARGET Corrade::rc)
if(CMAKE_CROSSCOMPILING)
find_program(CORRADE_RC_PROGRAM
NAMES corrade-rc
PATHS ENV
PATH NO_DEFAULT_PATH)
else()
Comment thread
leoparente marked this conversation as resolved.
find_program(CORRADE_RC_PROGRAM
NAMES corrade-rc
PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/"
NO_DEFAULT_PATH)
endif()

get_filename_component(CORRADE_RC_PROGRAM "${CORRADE_RC_PROGRAM}" ABSOLUTE)

add_executable(Corrade::rc IMPORTED)
set_property(TARGET Corrade::rc PROPERTY IMPORTED_LOCATION ${CORRADE_RC_PROGRAM})
endif()

# Include and declare other build modules
include("${CMAKE_CURRENT_LIST_DIR}/UseCorrade.cmake")
set(CORRADE_LIB_SUFFIX_MODULE "${CMAKE_CURRENT_LIST_DIR}/CorradeLibSuffix.cmake")
4 changes: 4 additions & 0 deletions conan/corrade/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"cci.20260327":
sha256: d8f30e9a857172003b6b02304783f40e8038c36e4127a0cfec7fe14f41c13fd4
url: https://github.com/mosra/corrade/archive/22e7ffc6fcdeaa0df96e0d8b3d482ad6abe7dc36.tar.gz
193 changes: 193 additions & 0 deletions conan/corrade/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
import os

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import cross_building
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.microsoft import is_msvc, check_min_vs

required_conan_version = ">=1.52.0"
Comment thread
leoparente marked this conversation as resolved.
Outdated


class CorradeConan(ConanFile):
name = "corrade"
description = "Corrade is a multiplatform utility library written in C++11/C++14."
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://magnum.graphics/corrade"
topics = ("magnum", "filesystem", "console", "environment", "os")

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
"build_deprecated": [True, False],
"with_interconnect": [True, False],
"with_main": [True, False],
"with_pluginmanager": [True, False],
"with_testsuite": [True, False],
"with_utility": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"build_deprecated": True,
"with_interconnect": True,
"with_main": True,
"with_pluginmanager": True,
"with_testsuite": True,
"with_utility": True,
}

def export_sources(self):
copy(self, "cmake/*", src=self.recipe_folder, dst=self.export_sources_folder)
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")

def validate(self):
check_min_vs(self, 190)
if not self.options.with_utility and (
self.options.with_testsuite or self.options.with_interconnect or self.options.with_pluginmanager
):
raise ConanInvalidConfiguration(
"Component 'utility' is required for 'test_suite', 'interconnect' and 'plugin_manager'"
)

def build_requirements(self):
if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True):
self.tool_requires(f"corrade/{self.version}")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.variables["BUILD_STATIC"] = not self.options.shared
tc.variables["BUILD_STATIC_PIC"] = self.options.get_safe("fPIC", False)

tc.variables["BUILD_DEPRECATED"] = self.options.build_deprecated
tc.variables["WITH_INTERCONNECT"] = self.options.with_interconnect
tc.variables["WITH_MAIN"] = self.options.with_main
tc.variables["WITH_PLUGINMANAGER"] = self.options.with_pluginmanager
tc.variables["WITH_TESTSUITE"] = self.options.with_testsuite
tc.variables["WITH_UTILITY"] = self.options.with_utility
tc.variables["WITH_RC"] = self.options.with_utility

# Corrade uses suffix on the resulting "lib"-folder when running cmake.install()
# Set it explicitly to empty, else Corrade might set it implicitly (eg. to "64")
tc.variables["LIB_SUFFIX"] = ""

if is_msvc(self):
if check_min_vs(self, 193, raise_invalid=False):
tc.variables["MSVC2019_COMPATIBILITY"] = True
elif check_min_vs(self, 192, raise_invalid=False):
tc.variables["MSVC2017_COMPATIBILITY"] = True
elif check_min_vs(self, 191, raise_invalid=False):
tc.variables["MSVC2015_COMPATIBILITY"] = True

tc.generate()
tc = CMakeDeps(self)
tc.generate()

def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure()
cmake.build()

def package(self):
copy(self, "COPYING", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
cmake = CMake(self)
cmake.install()
share_cmake = os.path.join(self.package_folder, "share", "cmake", "Corrade")
copy(self, "UseCorrade.cmake",
src=share_cmake,
dst=os.path.join(self.package_folder, "lib", "cmake"))
copy(self, "CorradeLibSuffix.cmake",
src=share_cmake,
dst=os.path.join(self.package_folder, "lib", "cmake"))
copy(self, "*.cmake",
src=os.path.join(self.export_sources_folder, "cmake"),
dst=os.path.join(self.package_folder, "lib", "cmake"))
rmdir(self, os.path.join(self.package_folder, "share"))

def package_info(self):
self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.set_property("cmake_file_name", "Corrade")
self.cpp_info.set_property("cmake_target_name", "Corrade::Corrade")

suffix = "-d" if self.settings.build_type == "Debug" else ""

cmake_modules = [
# Reproduces the variables and calls performed by the FindCorrade.cmake provided by the library
os.path.join("lib", "cmake", "conan-corrade-vars.cmake"),
# Autodetects LIB_SUFFIX (either "64" or "")
os.path.join("lib", "cmake", "CorradeLibSuffix.cmake"),
# Exports build flags and macros
os.path.join("lib", "cmake", "UseCorrade.cmake"),
]
self.cpp_info.set_property("cmake_build_modules", cmake_modules)
self.cpp_info.components["_corrade"].build_modules["cmake_find_package"] = cmake_modules
self.cpp_info.components["_corrade"].build_modules["cmake_find_package_multi"] = cmake_modules

if self.options.with_main:
self.cpp_info.components["main"].set_property("cmake_target_name", "Corrade::Main")
self.cpp_info.components["main"].names["cmake_find_package"] = "Main"
self.cpp_info.components["main"].names["cmake_find_package_multi"] = "Main"
if self.settings.os == "Windows":
self.cpp_info.components["main"].libs = ["CorradeMain" + suffix]
self.cpp_info.components["main"].requires = ["_corrade"]

if self.options.with_utility:
self.cpp_info.components["utility"].set_property("cmake_target_name", "Corrade::Utility")
self.cpp_info.components["utility"].names["cmake_find_package"] = "Utility"
self.cpp_info.components["utility"].names["cmake_find_package_multi"] = "Utility"
self.cpp_info.components["utility"].libs = ["CorradeUtility" + suffix]
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.components["utility"].system_libs = ["m", "dl"]
self.cpp_info.components["utility"].requires = ["_corrade"]

if self.options.with_interconnect:
self.cpp_info.components["interconnect"].set_property("cmake_target_name", "Corrade::Interconnect")
self.cpp_info.components["interconnect"].names["cmake_find_package"] = "Interconnect"
self.cpp_info.components["interconnect"].names["cmake_find_package_multi"] = "Interconnect"
self.cpp_info.components["interconnect"].libs = ["CorradeInterconnect" + suffix]
self.cpp_info.components["interconnect"].requires = ["utility"]

if self.options.with_pluginmanager:
self.cpp_info.components["plugin_manager"].set_property("cmake_target_name", "Corrade::PluginManager")
self.cpp_info.components["plugin_manager"].names["cmake_find_package"] = "PluginManager"
self.cpp_info.components["plugin_manager"].names["cmake_find_package_multi"] = "PluginManager"
self.cpp_info.components["plugin_manager"].libs = ["CorradePluginManager" + suffix]
self.cpp_info.components["plugin_manager"].requires = ["utility"]

if self.options.with_testsuite:
self.cpp_info.components["test_suite"].set_property("cmake_target_name", "Corrade::TestSuite")
self.cpp_info.components["test_suite"].names["cmake_find_package"] = "TestSuite"
self.cpp_info.components["test_suite"].names["cmake_find_package_multi"] = "TestSuite"
self.cpp_info.components["test_suite"].libs = ["CorradeTestSuite" + suffix]
self.cpp_info.components["test_suite"].requires = ["utility"]

if self.options.with_utility:
bindir = os.path.join(self.package_folder, "bin")
self.output.info(f"Appending PATH environment variable: {bindir}")
self.env_info.PATH.append(bindir)

# pkg_config: Add more explicit naming to generated files (avoid filesystem collision).
for key, component in self.cpp_info.components.items():
component.set_property("pkg_config_name", f"{self.name}_{key}")

self.cpp_info.names["cmake_find_package"] = "Corrade"
self.cpp_info.names["cmake_find_package_multi"] = "Corrade"
4 changes: 2 additions & 2 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.14.0")
self.requires("corrade/2020.06")
self.requires("corrade/cci.20260327")
Comment thread
leoparente marked this conversation as resolved.
Comment thread
leoparente marked this conversation as resolved.
Comment thread
leoparente marked this conversation as resolved.
Comment thread
leoparente marked this conversation as resolved.
self.requires("cpp-httplib/0.18.3")
self.requires("docopt.cpp/0.6.3")
self.requires("fast-cpp-csv-parser/cci.20240102")
Expand Down Expand Up @@ -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.20260327")
self.tool_requires("protobuf/6.33.5")

def layout(self):
Expand Down
8 changes: 5 additions & 3 deletions src/AbstractPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#pragma once

#include <Corrade/Containers/Array.h>
#include <Corrade/Containers/String.h>
#include <Corrade/PluginManager/AbstractPlugin.h>
#include <exception>
#include <nlohmann/json.hpp>
Expand Down Expand Up @@ -69,12 +71,12 @@ class AbstractPlugin : public Corrade::PluginManager::AbstractPlugin
}

public:
static std::vector<std::string> pluginSearchPaths()
static Corrade::Containers::Array<Corrade::Containers::String> pluginSearchPaths()
{
return {""};
return {Corrade::Containers::InPlaceInit, {""}};
}

explicit AbstractPlugin(Corrade::PluginManager::AbstractManager &manager, const std::string &plugin)
explicit AbstractPlugin(Corrade::PluginManager::AbstractManager &manager, const Corrade::Containers::StringView plugin)
: Corrade::PluginManager::AbstractPlugin{manager, plugin}
{
}
Expand Down
Loading
Loading