Skip to content

Commit

Permalink
switch nodejs dep. to node-api-headers and add napi_version option
Browse files Browse the repository at this point in the history
  • Loading branch information
enzalito committed Jul 12, 2024
1 parent 732d7cf commit 45bce35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/n/node-addon-api/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ package("node-addon-api")

add_configs("errors", {description = "Choose error handling method.", default = "except", type = "string", values = {"except", "noexcept", "maybe"}})
add_configs("disable_deprecated", {description = "Disable deprecated APIs.", default = true, type = "boolean"})
add_configs("napi_version", {description = "Target a specific Node-API version.", default = nil, type = "number"})

set_urls("https://github.com/nodejs/node-addon-api/archive/refs/tags/$(version).tar.gz",
"https://github.com/nodejs/node-addon-api.git")
add_versions("v8.0.0", "42424c5206b9d67b41af4fcff5d6e3cb22074168035a03b8467852938a281d47")

add_deps("nodejs")
add_deps("node-api-headers")

on_load(function(package)
package:add("defines", "NAPI_VERSION=" .. package:version():major())
package:add("defines", "NAPI_VERSION=" .. package:config("napi_version") or package:version():major())
if package:config("disable_deprecated") then
package:add("defines", "NODE_ADDON_API_DISABLE_DEPRECATED")
end
Expand Down

0 comments on commit 45bce35

Please sign in to comment.