Skip to content

Commit

Permalink
cmake modified to enable openmp on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
s2496214 committed Sep 3, 2024
1 parent 6e96799 commit 56ed4e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,13 @@ endif()

##############################################

if(MSVC)
if(NCNN_OPENMP AND NCNN_SIMPLEOMP)
# try to use /openmp in cl.exe instead -fopenmp
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp")
endif()
endif()

# set cmake default folder name
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "cmake")
Expand Down Expand Up @@ -687,7 +694,7 @@ if(NCNN_VULKAN)
endif()
endif()

if (TARGET glslang AND TARGET SPIRV)
if(TARGET glslang AND TARGET SPIRV)
get_property(glslang_location TARGET glslang PROPERTY LOCATION)
get_property(SPIRV_location TARGET SPIRV PROPERTY LOCATION)
message(STATUS "Found glslang: ${glslang_location} (found version \"${glslang_VERSION}\")")
Expand Down

0 comments on commit 56ed4e7

Please sign in to comment.