231103.1 · 7f4a9ed91bbecb84e39f4bc8030247ce5116ddf8
Reorganize examples into categorized folders (#341)
* refactor: create directory structure to organize exmaples
* test: update test_all to work with new directory structure
* fix: bug in test_all if no package.json scripts
* test: cleanup output of test_all
* fix: remove default test script that throws from thread_safe_function_with_object_wrap
* fix: remove build_with_cmake from .gitignore
* fix: swith to ' from " and remove subdir from getAllTests call
* test: add extra test cases for npm start and just running the pkgJson.main with node
* refactor: move all examples to src directory
* refactor: add numbers to categories so they are ordered in the src folder
* refactor: simplify getAllExamples in test_all.js
* docs: add directory structure to README.md
* docs: update directory structure to README.md
* docs: update directory structure to README.md
* docs: update directory structure to README.md
* docs: update directory structure example in readme
* add back build_with_cmake
---------
Co-authored-by: legendecas <legendecas@gmail.com>
reading declarations
Changes to src/6-threadsafe-function/threadsafe-async-iterator/node-addon-api/CMakeLists.txt. All files
src/6-threadsafe-function/threadsafe-async-iterator/node-addon-api/CMakeLists.txt
@@ -0,0 +1,23 @@+project (example)+include_directories(${CMAKE_JS_INC} node_modules/node-addon-api/)+cmake_minimum_required(VERSION 3.18)++set(CMAKE_CXX_STANDARD 20)+set(CMAKE_CXX_STANDARD_REQUIRED ON)+include_directories(${CMAKE_JS_INC})+file(GLOB SOURCE_FILES "*.cc")+add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})+set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")+target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB})++# Include Node-API wrappers+execute_process(COMMAND node -p "require('node-addon-api').include"+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}+ OUTPUT_VARIABLE NODE_ADDON_API_DIR+ )+string(REGEX REPLACE "[\r\n\"]" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})++target_include_directories(${PROJECT_NAME} PRIVATE ${NODE_ADDON_API_DIR})++# define NAPI_VERSION+add_definitions(-DNAPI_VERSION=6)