Comments (5)
@stek69 ,
Installation
CMake.js is a Node.js/io.js native addon build tool which works exactly like node-gyp, but instead of gyp, it is based on CMake build system.
npm install -g cmake-js
To compile a native module that uses only the
plain C
N-API calls,
follow the directions for plain node
native modules.
npm install --save-dev node-addon-api
To configure project
mkdir -p build_temp/node-api/
cd build_temp/node-api/
cmake-js configure -d ../../ -G "Visual Studio 14 2015" -O ./
To check cmake.js based builds
if(CMAKE_JS_VERSION)
add_subdirectory(src)
endif(CMAKE_JS_VERSION)
In your addon's CMakeLists.txt
target_include_directories(${PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/node_modules/node-addon-api
PRIVATE ${CMAKE_JS_INC})
target_link_libraries(${PROJECT_NAME} PRIVATE ${CMAKE_JS_LIB})
from node-addon-api.
Hi @langxiong,
now cmake-js supports N-API and node-addon-api. See: https://www.npmjs.com/package/cmake-js#n-api-and-node-addon-api
What do you think, should be possible close this issue?
from node-addon-api.
I'm closing the issue because now the usage of CMake is well supported and documented in https://www.npmjs.com/package/cmake-js#n-api-and-node-addon-api
from node-addon-api.
from node-addon-api.
Hi, I also ran into problems using gyp. Almost all have used libraries CMake.
How to build a project addon using CMake? After all, she's going to the library during the build of my addon.
from node-addon-api.
Related Issues (20)
- How to properly handle `Object/Buffer/Uint8Array` in `AsyncWorker`? HOT 9
- How about add C++20 coroutine support to `Napi::Value`? HOT 9
- Node throws exception in main thread (?) when trying to execute event via ThreadSafeFunction HOT 2
- Throwing an object as an exception? HOT 3
- Napi::Value is not properly initialized the first time a program is run HOT 22
- Strange behavior HOT 2
- How do I initialize a variable of type napi_value to NULL to avoid compiler warnings HOT 4
- Failures with VS2022 HOT 4
- Added 22 to test matrixes/deprecate EOL Node.js versions. HOT 2
- Add wrappers for `node_api_nogc_env` and `node_api_nogc_finalize` HOT 8
- `function_reference` test failure when using Debug build of node v20.13.1
- Turn on experimental in ci-win.yml
- Next release HOT 1
- Differentiate an instance of Uint8Array versus Buffer HOT 6
- InstanceMethod does not accept function returning Napi::Object
- Improve coverage report with experimental runs
- Discussion: Naming of envs HOT 6
- Discussion: Formatting inconsistency in markdown documentation HOT 1
- Create a 7.1.1 branch backing out one commit HOT 2
- AsyncProgressQueueWorker hangs on elements more than two HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-addon-api.