File tree Expand file tree Collapse file tree 6 files changed +660
-0
lines changed
packages/node-addon-examples
tests/threadsafe_function Expand file tree Collapse file tree 6 files changed +660
-0
lines changed Original file line number Diff line number Diff line change @@ -85,5 +85,7 @@ export const suites: Record<
8585 require ( "../tests/buffers/addon.js" ) ;
8686 } ,
8787 async : ( ) => require ( "../tests/async/addon.js" ) as ( ) => Promise < void > ,
88+ threadsafe_function : ( ) =>
89+ require ( "../tests/threadsafe_function/addon.js" ) as ( ) => Promise < void > ,
8890 } ,
8991} ;
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.15)
2+ project (tests-threadsafe_function)
3+
4+ add_compile_definitions (NAPI_VERSION=8)
5+
6+ add_library (addon SHARED addon.cpp ${CMAKE_JS_SRC} )
7+ set_target_properties (addon PROPERTIES PREFIX "" SUFFIX ".node" )
8+ target_include_directories (addon PRIVATE "/Users/kamil.paradowski/projects/napi/node_modules/node-addon-api" ${CMAKE_JS_INC} )
9+ target_link_libraries (addon PRIVATE ${CMAKE_JS_LIB} )
10+ target_compile_features (addon PRIVATE cxx_std_17)
11+ target_compile_definitions (addon PRIVATE NAPI_DISABLE_CPP_EXCEPTIONS)
12+
13+ if (MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
14+ # Generate node.lib
15+ execute_process (COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS} )
16+ endif ()
You can’t perform that action at this time.
0 commit comments