增量构建节点gyp项目

时间:2016-08-31 19:01:43

标签: c++ node-gyp

我正在摆弄node-mariasql源代码,想要改变一些东西,并在我去的时候重建项目。我的直观方法是从项目的根目录运行node-gyp rebuild。不幸的是,它看起来总是重新构建整个项目,即使我只是对其中一个源文件进行了更改:

~/Documents/workspace/node-mariasql$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.4.0
gyp info using node@4.4.7 | linux | x64
...
make: Entering directory '/home/vagrant/Documents/workspace/node-mariasql/build'
  CXX(target) Debug/obj.target/taocrypt/deps/libmariadbclient/extra/yassl/taocrypt/src/aes.o
  CXX(target) Debug/obj.target/taocrypt/deps/libmariadbclient/extra/yassl/taocrypt/src/aestables.o
  ... (and so on...)

  CC(target) Debug/obj.target/zlib/deps/libmariadbclient/zlib/zutil.o
  AR(target) Debug/obj.target/deps/libmariadbclient/zlib/zlib.a
  COPY Debug/zlib.a
  CXX(target) Debug/obj.target/sqlclient/src/binding.o
../src/binding.cc:71:0: warning: "DEBUG" redefined [enabled by default]
  SOLINK_MODULE(target) Debug/obj.target/sqlclient.node
  COPY Debug/sqlclient.node
make: Leaving directory '/home/vagrant/Documents/workspace/node-
mariasql/build'
gyp info ok 

构建过程需要一段时间,如何逐步构建项目?

1 个答案:

答案 0 :(得分:1)

根据文档,node-gyp rebuild连续运行cleanconfigurebuild命令。只需运行node-gyp build即可调用make。