-
-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add c-vector * fix kind value * fix for windows
- Loading branch information
1 parent
bec7be4
commit 354d61e
Showing
1 changed file
with
31 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,31 @@ | ||
package("c-vector") | ||
set_homepage("https://github.com/Mashpoe/c-vector") | ||
set_description("A simple vector library for C that can store any type.") | ||
set_license("BSD-3-Clause") | ||
|
||
add_urls("https://github.com/Mashpoe/c-vector/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/Mashpoe/c-vector.git") | ||
|
||
add_versions("v1.0", "c1ddd2975abd54ce55309fef04cc9d47e8a356a964298f516a9e314f9fcd20d4") | ||
|
||
on_install(function (package) | ||
local configs = {} | ||
io.writefile("xmake.lua", [[ | ||
add_rules("mode.release", "mode.debug") | ||
target("c-vector") | ||
set_kind("$(kind)") | ||
add_files("vec.c") | ||
add_headerfiles("vec.h") | ||
if is_plat("windows") and is_kind("shared") then | ||
add_rules("utils.symbols.export_all") | ||
end | ||
]]) | ||
if package:config("shared") then | ||
configs.kind = "shared" | ||
end | ||
import("package.tools.xmake").install(package, configs) | ||
end) | ||
|
||
on_test(function (package) | ||
assert(package:has_cfuncs("vector_create", {includes = "vec.h"})) | ||
end) |