【发布时间】:2022-10-01 11:09:50
【问题描述】:
我开始使用“node-addon-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) 时,所有内容都会重新编译,而且速度有点慢,因此欢迎避免重新编译所有文件,尤其是当项目变得更大时。
我只能找到this page,但添加该标志并没有做任何事情(在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\' ] }
}
}]
}
先感谢您!
标签: node.js node-modules compiler-warnings node-addon-api