Skip to content

Commit

Permalink
EMNAPI_DISABLE_UV
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jun 21, 2024
1 parent 0721f43 commit 5f4b9f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/emnapi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ endif()
add_library(${EMNAPI_BASIC_TARGET_NAME} STATIC ${ENAPI_BASIC_SRC})
target_include_directories(${EMNAPI_BASIC_TARGET_NAME} PUBLIC ${EMNAPI_INCLUDE})
target_compile_definitions(${EMNAPI_BASIC_TARGET_NAME} PUBLIC ${EMNAPI_DEFINES})
target_compile_definitions(${EMNAPI_BASIC_TARGET_NAME} PRIVATE "EMNAPI_DISABLE_UV")
if(IS_EMSCRIPTEN)
set_target_properties(${EMNAPI_BASIC_TARGET_NAME} PROPERTIES INTERFACE_LINK_DEPENDS ${EMNAPI_JS_LIB})
target_link_options(${EMNAPI_BASIC_TARGET_NAME} INTERFACE "--js-library=${EMNAPI_JS_LIB}")
Expand All @@ -161,6 +162,7 @@ if(EMNAPI_BUILD_BASIC_MT)
target_compile_options(${EMNAPI_BASIC_MT_TARGET_NAME} PUBLIC "-matomics" "-mbulk-memory")
target_include_directories(${EMNAPI_BASIC_MT_TARGET_NAME} PUBLIC ${EMNAPI_INCLUDE})
target_compile_definitions(${EMNAPI_BASIC_MT_TARGET_NAME} PUBLIC ${EMNAPI_DEFINES})
target_compile_definitions(${EMNAPI_BASIC_MT_TARGET_NAME} PRIVATE "EMNAPI_DISABLE_UV")

if(IS_EMSCRIPTEN)
set_target_properties(${EMNAPI_BASIC_MT_TARGET_NAME} PROPERTIES INTERFACE_LINK_DEPENDS ${EMNAPI_JS_LIB})
Expand Down
4 changes: 2 additions & 2 deletions packages/emnapi/src/node_api.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "node_api.h"
#include "emnapi_internal.h"

#if EMNAPI_HAVE_THREADS
#if EMNAPI_HAVE_THREADS && !defined(EMNAPI_DISABLE_UV)
#include "uv.h"
#endif

Expand Down Expand Up @@ -31,7 +31,7 @@ napi_get_node_version(napi_env env,

napi_status napi_get_uv_event_loop(napi_env env,
struct uv_loop_s** loop) {
#if EMNAPI_HAVE_THREADS
#if EMNAPI_HAVE_THREADS && !defined(EMNAPI_DISABLE_UV)
CHECK_ENV(env);
CHECK_ARG(env, loop);
// Though this is fake libuv loop
Expand Down

0 comments on commit 5f4b9f5

Please sign in to comment.