Skip to content

Add cmake-js options command #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SiarheiFedartsou
Copy link

@SiarheiFedartsou SiarheiFedartsou commented Nov 10, 2022

Idea

I want to try cmake-js in project which is CMake-based, but it is not only NodeJs addon, but also usual C++ library, so in our CI we will have to use not only cmake-js commands, but also usual CMake commands too, i.e. it leads to a lot of if-else in CI code(if node_addon: cmake-js .. else: cmake ..). The idea is to continue using CMake, but with a little help of cmake-js when we build Node-related things, i.e. something like this:

cmake -DMY_OWN_OPTION1=ON -DMY_ANOTHER_OPTION2=OFF $(cmake-js options) ..
ninja

So this PR is draft implementing this use case, but before polishing it would be great to hear maintainers opinion :)

@SiarheiFedartsou
Copy link
Author

Hi @Julusian, as I can see you are the maintainer of this repo, so would be great to have your opinion here :)

@@ -199,13 +204,46 @@ CMake.prototype.getConfigureCommand = async function (nodeLibDefPath) {
for (const [key, value] of Object.entries(this.cMakeOptions)) {
D.push({ [key]: value });
}
if (this.toolset.cppCompilerPath) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure all of these options should be there though, but it is to be discussed.

@Julusian Julusian added this to the v8.0.0 milestone Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants