From d579b5da3fa7c3b1b13dc369e54243660e1225d7 Mon Sep 17 00:00:00 2001 From: s2496214 Date: Fri, 6 Sep 2024 18:53:57 +0800 Subject: [PATCH] turn off the NCNN_THREAD when compile with MSVC --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d6269757c9..7e5aebaddb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") @@ -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