Skip to content

Commit

Permalink
turn off the NCNN_THREAD when compile with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
s2496214 committed Sep 6, 2024
1 parent eb126f9 commit d579b5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ endif()
##############################################

if(MSVC)
set(NCNN_THREADS OFF)
if(NCNN_OPENMP AND NCNN_SIMPLEOMP)
# try to use /openmp in cl.exe instead -fopenmp
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp")
Expand All @@ -659,7 +660,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s FORCE_FILESYSTEM=1 -s INITIAL_MEMORY=256MB -s EXIT_RUNTIME=1")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s FORCE_FILESYSTEM=1 -s INITIAL_MEMORY=256MB -s EXIT_RUNTIME=1")
set(CMAKE_EXECUTBLE_LINKER_FLAGS "${CMAKE_EXECUTBLE_LINKER_FLAGS} -s FORCE_FILESYSTEM=1 -s INITIAL_MEMORY=256MB -s EXIT_RUNTIME=1")

if(NCNN_OPENMP AND NCNN_SIMPLEOMP)
# TODO better flags for emscripten
# node --experimental-wasm-threads xxx.js
Expand Down

0 comments on commit d579b5d

Please sign in to comment.