我开始使用‘following api’,虽然我的代码确实编译和运行,但我确实收到了以下警告:
Generating code
Previous IPDB not found, fall back to full compilation.
All 303 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code实际上,当我运行命令(node-gyp rebuild -j max)时,所有的东西都会重新编译,而且速度有点慢,所以避免重新编译所有文件都是受欢迎的,特别是当项目变得更大时。
我所能找到的只有此页,但是添加这个标志没有任何作用(无论是在cflags、cflags_cc还是msvs_settings下)。这是我的binding.gyp
{
"targets": [{
"target_name": "template",
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"sources": [
"src/cpp/wrapper.cpp",
"src/cpp/functionexample.cpp"
],
'include_dirs': [
"<!@(node -p \"require('node-addon-api').include\")"
],
'libraries': [],
'dependencies': [
"<!(node -p \"require('node-addon-api').gyp\")"
],
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ],
'msvs_settings': {
'VCCLCompilerTool': { "ExceptionHandling": 1, 'AdditionalOptions': [ '-std:c++20' ] }
}
}]
}提前谢谢你!
发布于 2022-10-01 03:09:50
rebuild应该从头开始重新编译所有的东西--您正在寻找build。
rebuild运行clean、configure和build
clean将删除它-删除以前编译过的对象configure为当前平台生成项目构建文件。build调用make/msbuild.exe并构建本机插件build将旧版本与源代码进行比较,查找更改,并仅重新构建更改的代码--也就是说,build并不总是完美的,因此可能需要偶尔的rebuild。
https://stackoverflow.com/questions/72327639
复制相似问题