From 430ee1c7b5ed7fb35e6ba99c83f3e828560a1c93 Mon Sep 17 00:00:00 2001 From: "clement.igonet" Date: Tue, 24 Dec 2024 08:39:20 +0100 Subject: [PATCH] cmock: add new recipe --- recipes/cmock/all/conandata.yml | 4 +++ recipes/cmock/all/conanfile.py | 48 +++++++++++++++++++++++++++++++++ recipes/cmock/config.yml | 3 +++ 3 files changed, 55 insertions(+) create mode 100644 recipes/cmock/all/conandata.yml create mode 100644 recipes/cmock/all/conanfile.py create mode 100644 recipes/cmock/config.yml diff --git a/recipes/cmock/all/conandata.yml b/recipes/cmock/all/conandata.yml new file mode 100644 index 0000000000000..be863d50b64ec --- /dev/null +++ b/recipes/cmock/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "2.5.3": + url: "https://github.com/ThrowTheSwitch/CMock/archive/refs/tags/v2.5.3.tar.gz" + sha256: "d30724405b527f2b1d2894b27a1600af3ccb4aad12e63e48ba4f0ea8ae88fe9c" \ No newline at end of file diff --git a/recipes/cmock/all/conanfile.py b/recipes/cmock/all/conanfile.py new file mode 100644 index 0000000000000..430f18d7b9d85 --- /dev/null +++ b/recipes/cmock/all/conanfile.py @@ -0,0 +1,48 @@ +from conan import ConanFile +from conan.tools.layout import basic_layout +from conan.tools.files import copy, get, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class UnityConan(ConanFile): + exports_sources = "src/*" + name = "cmock" + description = "CMock is a mock and stub generator and runtime for unit testing C. It's been designed to work smoothly with Unity Test," + topics = ("mock", "unit-test", "testing") + license = "MIT" + homepage = "http://www.throwtheswitch.org" + url = "https://github.com/conan-io/conan-center-index" + package_type = "static-library" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def requirements(self): + self.requires("unity/2.5.2") + + def layout(self): + basic_layout(self) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def package(self): + copy(self, "LICENSE.txt", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + + def package_info(self): + self.cpp_info.libs = ["cmock"] + self.cpp_info.includedirs = ["include", "include/cmock"] diff --git a/recipes/cmock/config.yml b/recipes/cmock/config.yml new file mode 100644 index 0000000000000..def630db182e8 --- /dev/null +++ b/recipes/cmock/config.yml @@ -0,0 +1,3 @@ +versions: + "2.5.3": + folder: all