Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmock: add new recipe #26259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions recipes/cmock/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"2.5.3":
url: "https://github.com/ThrowTheSwitch/CMock/archive/refs/tags/v2.5.3.tar.gz"
sha256: "d30724405b527f2b1d2894b27a1600af3ccb4aad12e63e48ba4f0ea8ae88fe9c"
48 changes: 48 additions & 0 deletions recipes/cmock/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 3 additions & 0 deletions recipes/cmock/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"2.5.3":
folder: all