-
-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab4786e
commit 819d720
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package("qcbor") | ||
set_homepage("https://github.com/laurencelundblade/QCBOR") | ||
set_description("Comprehensive, powerful, commercial-quality CBOR encoder/ decoder that is still suited for small devices.") | ||
set_license("BSD-3-Clause") | ||
|
||
add_urls("https://github.com/laurencelundblade/QCBOR/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/laurencelundblade/QCBOR.git") | ||
|
||
add_versions("v1.4.1", "c7ef031b60b23bf8ede47c66c9713982bba2608668b144280a65665bfcc94470") | ||
|
||
add_configs("float_hw_use", {description = "Eliminate dependency on FP hardware and FP instructions", default = false, type = "boolean"}) | ||
add_configs("float_preferred", {description = "Eliminate support for half-precision and CBOR preferred serialization", default = false, type = "boolean"}) | ||
add_configs("float_all", {description = "Eliminate floating-point support completely", default = false, type = "boolean"}) | ||
|
||
if is_plat("linux", "bsd") then | ||
add_syslinks("m") | ||
end | ||
|
||
add_deps("cmake") | ||
|
||
on_install(function (package) | ||
local configs = {} | ||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) | ||
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) | ||
if package:config("shared") and package:is_plat("windows") then | ||
table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON") | ||
end | ||
|
||
table.insert(configs, "-DQCBOR_OPT_DISABLE_FLOAT_HW_USE=" .. (package:config("float_hw_use") and "OFF" or "ON")) | ||
table.insert(configs, "-DQCBOR_OPT_DISABLE_FLOAT_PREFERRED=" .. (package:config("float_preferred") and "OFF" or "ON")) | ||
table.insert(configs, "-DQCBOR_OPT_DISABLE_FLOAT_ALL=" .. (package:config("float_all") and "OFF" or "ON")) | ||
import("package.tools.cmake").install(package, configs) | ||
end) | ||
|
||
on_test(function (package) | ||
assert(package:has_cfuncs("QCBOREncode_Init", {includes = "qcbor/qcbor_encode.h"})) | ||
end) |