Skip to content

Commit

Permalink
update NAPI_VERSION defined in configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jun 25, 2023
1 parent 2ea74ec commit db11419
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
{
"name": "Emscripten",
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=8"],
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=2147483647"],
"compilerPath": "${env:EMSDK}/upstream/emscripten/emcc",
"intelliSenseMode": "linux-clang-x86",
"cStandard": "c11",
Expand All @@ -58,7 +58,7 @@
},
{
"name": "Win32 Emscripten",
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=8"],
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=2147483647"],
"compilerPath": "${env:EMSDK}\\upstream\\emscripten\\emcc.bat",
"intelliSenseMode": "linux-clang-x86",
"cStandard": "c11",
Expand Down
2 changes: 1 addition & 1 deletion packages/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TY
set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}" CACHE PATH "pdb output")
project(emnapibench)
add_compile_definitions(
"NAPI_VERSION=8"
"NAPI_VERSION=9"
"NAPI_DISABLE_CPP_EXCEPTIONS"
"NODE_ADDON_API_ENABLE_MAYBE"
)
Expand Down
4 changes: 2 additions & 2 deletions packages/node/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
{
"name": "Emscripten",
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=8"],
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=2147483647"],
"compilerPath": "${env:EMSDK}/upstream/emscripten/emcc",
"intelliSenseMode": "linux-clang-x86",
"cStandard": "c11",
Expand All @@ -57,7 +57,7 @@
},
{
"name": "Win32 Emscripten",
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=8"],
"defines": ["${defines}", "__wasm__", "__EMSCRIPTEN_PTHREADS__", "NAPI_VERSION=2147483647"],
"compilerPath": "${env:EMSDK}\\upstream\\emscripten\\emcc.bat",
"intelliSenseMode": "linux-clang-x86",
"cStandard": "c11",
Expand Down
4 changes: 1 addition & 3 deletions packages/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS})
endif()

# add_compile_definitions("NAPI_VERSION=8")

if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(IS_EMSCRIPTEN ON)
else()
Expand Down Expand Up @@ -212,7 +210,7 @@ function(add_naa_test NAME SOURCE_LIST DEFINES ENABLE_EXCEPTION)
target_link_libraries(${NAME} PRIVATE ${CMAKE_JS_LIB})
endif()

target_compile_definitions(${NAME} PRIVATE "NAPI_VERSION=8")
target_compile_definitions(${NAME} PRIVATE "NAPI_VERSION=9")

set_target_properties(${NAME} PROPERTIES
BUILD_RPATH "$ORIGIN")
Expand Down
2 changes: 1 addition & 1 deletion packages/test/script/test-build-all-napi-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { spawn } = require('../../../script/spawn.js')
const { which } = require('../../../script/which.js')

async function main () {
const testVersions = [1, 2, 3, 4, 5, 6, 7, 8, 9]
const testVersions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 2147483647]
const cwd = path.join(__dirname, '../../..')
let emcmake = process.platform === 'win32' ? 'emcmake.bat' : 'emcmake'
if (process.env.EMSDK) {
Expand Down

0 comments on commit db11419

Please sign in to comment.