It would be nice if the build dir can be set to something other than "build". Either via the binding.gyp or via an option of the node-gyp commands.
What's your use-case?
We are writing a tool that can compile modules for different middle wares, such as ros, yarp and nodejs. Therefore it is nice to compile them in different build dirs.
See: https://github.com/dobots/aimtools
Do you have an idea how to do it (via command option or binding.gyp and which files to edit)? I'm willing to help, but don't know how to do it in a good way :)
Its not the same as pre-defining the build directory, but the node-sqlite3 gyp file shows how to move the targets after the fact: https://github.com/developmentseed/node-sqlite3/blob/master/binding.gyp. I use this to ease packaging whereby it allows safely removing the entire build directory to save space. So, you might be able to use gyp pre or post build actions to accomplish what you want rather than needed to change node-gyp behavior.
Thanks, i didn't know of that option.
Was there an update to this? See also: https://github.com/nodejs/node-gyp/issues/631
@peterbraden - looks like there has not been any action by anyone to make this configurable. It would not likely be too hard, but it is still hardcoded right here: https://github.com/nodejs/node-gyp/blob/625c1515f9e00a9ea933ef78c00463ffba642f19/lib/configure.js#L257.
It is so sad this has not been fixed since 2013. :(
I too once had this deep desire filling my soul to change my output directory. Upon further research, I have learned it is unsupported. This saddens me. I have laid awake several nights in a row now pondering life's great questions, and this is one of them.
I appreciate you taking the time to read this, and hopefully one day this issue will be dominated in the most satisfying possible way, which is committed, completed, and compiled.
Thanks,
Your loving friend,
Michael, ThePrimeagen, Paulson
Literally the worst comment ever, you should be banned
Heads up: I'm putting this issue on notice. If you want to see this feature merged, please pick up #919 - it's close but it needs minor fixes and a rebase and its original author no longer has time.
It's been a week and no one stepped up so I'm going to close this out. For anyone still wanting to move forward with this, please adopt #919 and we'll take it from there.
Most helpful comment
I too once had this deep desire filling my soul to change my output directory. Upon further research, I have learned it is unsupported. This saddens me. I have laid awake several nights in a row now pondering life's great questions, and this is one of them.
I appreciate you taking the time to read this, and hopefully one day this issue will be dominated in the most satisfying possible way, which is committed, completed, and compiled.
Thanks,
Your loving friend,
Michael, ThePrimeagen, Paulson