Skip to content

Commit

Permalink
refactor: add flag on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zcf0508 committed Feb 29, 2024
1 parent ab69f42 commit 23363d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion script/vad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${NODE_ADDON_API_DIR})
#==================================================================

target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB} ${FASTDEPLOY_LIBS})
target_link_options(${PROJECT_NAME} PRIVATE ${CMAKE_SHARED_LINKER_FLAGS})

if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
target_link_options(${PROJECT_NAME} PRIVATE ${CMAKE_SHARED_LINKER_FLAGS})
endif ()

if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
# Generate node.lib
Expand Down
5 changes: 4 additions & 1 deletion script/whisper.cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ target_include_directories(${TARGET} PRIVATE ${NODE_ADDON_API_DIR})
#==================================================================

target_link_libraries(${TARGET} ${CMAKE_JS_LIB} common whisper ${CMAKE_THREAD_LIBS_INIT})
target_link_options(${TARGET} PRIVATE ${CMAKE_SHARED_LINKER_FLAGS})

if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
target_link_options(${TARGET} PRIVATE ${CMAKE_SHARED_LINKER_FLAGS})
endif ()

if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
# Generate node.lib
Expand Down

0 comments on commit 23363d2

Please sign in to comment.