-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Referring to these lines here:
node-api-example-lib/package.json
Lines 26 to 30 in 3cdfba5
"binary": { | |
"napi_versions": [ | |
3 | |
] | |
}, |
The binary field is documented on this third-party site. It sounds like it should be used together with the following cmake code:
add_compile_definitions(NAPI_VERSION=${napi_build_version})
However, it appears we're hard-coding that:
node-api-example-lib/CMakeLists.txt
Line 4 in 3cdfba5
add_compile_definitions(-DNAPI_VERSION=4) |
We should either omit it from the package.json altogether or feed it into CMakeLists as a variable.
My worry about it being in the package.json is that library authors might not understand what it's for and delete it by accident. Though if the CMakeLists.txt would take it as an optional variable and simply fall back to a given value if it's omitted, then we'd get the best of both worlds.