package An official xmake package repository
https://xrepo.xmake.io/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
988 B
20 lines
988 B
4 years ago
|
package("cmocka")
|
||
|
|
||
|
set_homepage("https://cmocka.org/")
|
||
|
set_description("cmocka is an elegant unit testing framework for C with support for mock objects.")
|
||
|
set_license("Apache-2.0")
|
||
|
|
||
|
add_urls("https://cmocka.org/files/$(version).tar.xz", {version = function (version) return table.concat(table.slice(version:split('%.'), 1, 2), '.') .. "/cmocka-" .. version end})
|
||
|
add_versions("1.1.5", "f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6")
|
||
|
|
||
|
add_deps("cmake")
|
||
|
on_install("windows", "linux", "macosx", "mingw", function (package)
|
||
|
local configs = {"-DUNIT_TESTING=OFF", "-DWITH_EXAMPLES=OFF"}
|
||
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
||
|
import("package.tools.cmake").install(package, configs)
|
||
|
end)
|
||
|
|
||
|
on_test(function (package)
|
||
|
assert(package:has_cfuncs("cmocka_set_test_filter", {includes = {"stdarg.h", "stddef.h", "setjmp.h", "stdint.h", "cmocka.h"}}))
|
||
|
end)
|