Skip to content

Commit

Permalink
add libatomic_ops
Browse files Browse the repository at this point in the history
  • Loading branch information
heheda123123 committed Jun 26, 2024
1 parent 303ce83 commit d5912d7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/l/libatomic_ops/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package("libatomic_ops")
set_homepage("https://github.com/ivmai/libatomic_ops")
set_description("The atomic_ops project (Atomic memory update operations portable implementation)")

add_urls("https://github.com/ivmai/libatomic_ops/releases/download/v$(version)/libatomic_ops-$(version).tar.gz",
"https://github.com/ivmai/libatomic_ops.git")

add_versions("7.8.2", "d305207fe207f2b3fb5cb4c019da12b44ce3fcbc593dfd5080d867b1a2419b51")

add_deps("cmake")

on_install(function (package)
local configs = {}
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "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({test=[[
void test() {
AO_t atomic_var;
}
]]}),{configs = {includes = "atomic_ops.h"}})
end)

0 comments on commit d5912d7

Please sign in to comment.