Skip to content

Commit

Permalink
Fixed openmp android build.
Browse files Browse the repository at this point in the history
  • Loading branch information
proydakov committed May 22, 2020
1 parent 33e7c8f commit 5f52b9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ if (NOT APPLE)
set(OpenMP_CXX_FLAGS "/openmp ${OpenMP_CXX_FLAGS}")
endif()
FOREACH(TARGET ${MNN_TARGETS})
target_link_libraries(${TARGET} OpenMP::OpenMP_CXX)
IF(WIN32)
target_compile_options(${TARGET} PUBLIC /openmp ${OpenMP_CXX_FLAGS} ${OpenMP_C_FLAGS})
ELSE()
Expand Down Expand Up @@ -498,6 +497,9 @@ if(APPLE)
endif()
add_dependencies(MNN MNNCore MNNCV MNNShape MNNMath MNNCompute MNNCPU GenVCSHDR)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tools/converter)
if(TARGET OpenMP::OpenMP_CXX)
target_link_libraries(MNN PUBLIC OpenMP::OpenMP_CXX)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "^Linux")
# Using -pthread, needed by thread-safe implemention of glibc, is better than only using -lpthread
Expand Down

0 comments on commit 5f52b9b

Please sign in to comment.