From dbfc66dca734877f0696bb6c53a6901483bd92cc Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 24 Jan 2024 15:41:59 +0100 Subject: [PATCH] ensure that grpc and protobuf aren't used Contributes to NP-5 --- CMakeLists.txt | 14 ++++++++------ conandata.yml | 3 ++- conanfile.py | 12 ++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5aca49732..908d34746b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,20 +18,23 @@ option(ENABLE_MORE_COMPILER_OPTIMIZATION_FLAGS "Enable more optimization flags" option(USE_SYSTEM_LIBS "Use the system libraries if available" OFF) option(OLDER_APPLE_CLANG "Apple Clang <= 13 used" OFF) -# Generate the plugin types -find_package(protobuf REQUIRED) option(OLDER_APPLE_CLANG "Apple Clang <= 13 used" OFF) -MESSAGE(STATUS "Compiling with plugins support: ${ENABLE_PLUGINS}") +if (${ENABLE_ARCUS} OR ${ENABLE_PLUGINS}) + find_package(protobuf REQUIRED) +endif () + +MESSAGE(STATUS "Building with plugins support: ${ENABLE_PLUGINS}") if (${ENABLE_PLUGINS}) find_package(asio-grpc REQUIRED) find_package(gRPC REQUIRED) find_package(curaengine_grpc_definitions REQUIRED) + find_package(semver REQUIRED) MESSAGE(STATUS "Plugin secure remotes allowed: ${ENABLE_REMOTE_PLUGINS}") endif () -if (ENABLE_ARCUS) - message(STATUS "Building with Arcus") +message(STATUS "Building with Arcus: ${ENABLE_ARCUS}") +if (${ENABLE_ARCUS}) find_package(arcus REQUIRED) protobuf_generate_cpp(engine_PB_SRCS engine_PB_HEADERS Cura.proto) endif () @@ -200,7 +203,6 @@ find_package(spdlog REQUIRED) find_package(fmt REQUIRED) find_package(range-v3 REQUIRED) find_package(scripta REQUIRED) -find_package(semver REQUIRED) if (ENABLE_SENTRY) find_package(sentry REQUIRED) diff --git a/conandata.yml b/conandata.yml index a0e277c652..14cf72dc44 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,6 +1,7 @@ version: "5.7.0-alpha.1" requirements: - - "arcus/5.3.1" - "scripta/0.1.0@ultimaker/testing" +requirements_arcus: + - "arcus/5.3.1" requirements_plugins: - "curaengine_grpc_definitions/(latest)@ultimaker/testing" diff --git a/conanfile.py b/conanfile.py index a1795be99f..c811bc6797 100644 --- a/conanfile.py +++ b/conanfile.py @@ -72,7 +72,8 @@ def config_options(self): def configure(self): self.options["boost"].header_only = True self.options["clipper"].shared = True - self.options["protobuf"].shared = False + if self.options.enable_arcus or self.options.enable_plugins: + self.options["protobuf"].shared = False if self.options.enable_arcus: self.options["arcus"].shared = True if self.settings.os == "Linux": @@ -101,20 +102,20 @@ def build_requirements(self): def requirements(self): for req in self.conan_data["requirements"]: - if "arcus" in req and not self.options.enable_arcus: - continue self.requires(req) + if self.options.enable_arcus: + for req in self.conan_data["requirements_arcus"]: + self.requires(req) if self.options.get_safe("enable_sentry", False): self.requires("sentry-native/0.6.5") if self.options.enable_plugins: + self.requires("neargye-semver/0.3.0") self.requires("asio-grpc/2.6.0") self.requires("grpc/1.50.1") for req in self.conan_data["requirements_plugins"]: self.requires(req) if self.options.enable_arcus or self.options.enable_plugins: self.requires("protobuf/3.21.9") - self.requires("asio-grpc/2.6.0") - self.requires("grpc/1.50.1") self.requires("clipper/6.4.2@ultimaker/stable") self.requires("boost/1.82.0") self.requires("rapidjson/1.1.0") @@ -122,7 +123,6 @@ def requirements(self): self.requires("spdlog/1.12.0") self.requires("fmt/10.1.1") self.requires("range-v3/0.12.0") - self.requires("neargye-semver/0.3.0") self.requires("zlib/1.2.12") self.requires("openssl/3.2.0")