EmbeddedEnterprises / cmake-ts

Typescript based rewrite of cmake-js to support cross compilation
9 stars 3 forks source link

How can I use this package? #9

Open aminya opened 3 years ago

aminya commented 3 years ago

I wanted to use this package, but I have a couple of questions:

I was going to start a similar project, but I saw this repository. I think it has very good potential, and if we can solve the above questions, I will start to use it for a couple of native packages. I can help with the development of this repository!

martin31821 commented 3 years ago

That's a good point, i'll see whether I can add a full fledged example.

aminya commented 3 years ago

This package comes as a CLI tool, which needs to be invoked during the build step of a native addon.

There was no documentation on this. We need should add those.

Tests were planned, however not a priority right now.

I think a minimal test is very important. Otherwise, it is always hard to change anything on the codebase.

No prebuildify is currently here.

That is not very hard to make. We can work on this.

We only support one build type at a time, what's your use case for having both?

I don't really need two builds at the same time, but I don't want to edit package.json. Maybe a flag should be passed to the CLI to specify the build type instead of the package.json entry

cmake-ts . --buildType Debug

This also allows testing both build types in the CI.

We only support NAN at this time.

Supporting N-api is very important. Without that, I cannot use CMake-ts. It is highly recommended to use N-api instead of NAN.

martin31821 commented 3 years ago

Agree on the first points, I like the build type override.

Unfortunately, nan is a bit hardwired at the moment, that's something we need to make more pluggable. I agree to add n-api support, but I don't have an example library using n-api.

aminya commented 3 years ago

I have an N-API library called Zadeh. I wanted to transfer this to Cmake-ts.

https://github.com/atom-community/zadeh

aminya commented 3 years ago

I added NAPI support in #14. Although I have not tested it yet. If you can first try your NAN package with this branch, it would be great. Then, if it was working, I will go ahead and transfer Zadeh (which uses node-addon-api) to Cmake-ts.

martin31821 commented 3 years ago

I'll try it, looks good at first sight.

aminya commented 3 years ago

@martin31821 Any news? Were you able to test #14?

If you can add one of the Cmake file examples you showed me in our meeting to the repository, it would be awesome. This also helps me to continue the development of this repository.

aminya commented 2 years ago

A year later, I am still searching for a usage example.

MrTob commented 1 year ago

same here, pls help me. i want to migrate from cmake-js to cmake-ts how to include the built ".node" file into an angular electron app?

aminya commented 2 days ago

Hey @martin31821, I am still interested in making cmake-ts a successful project. I see that the project is unmaintained. Would you be interested in adding me as a maintainer?

I have managed to make a fully working example for zeromq.js. Take a look here: https://github.com/zeromq/zeromq.js/pull/665