File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,12 +44,6 @@ if(ITLABAI_ENABLE_OPENMP)
4444 if (OpenMP_FOUND)
4545 message (STATUS "OpenMP found - enabling parallel support" )
4646 list (APPEND ITLABAI_FEATURE_DEFS HAS_OPENMP)
47- if (OpenMP_CXX_FLAGS)
48- add_compile_options (${OpenMP_CXX_FLAGS} )
49- endif ()
50- if (OpenMP_EXE_LINKER_FLAGS)
51- add_link_options (${OpenMP_EXE_LINKER_FLAGS} )
52- endif ()
5347 endif ()
5448endif ()
5549
Original file line number Diff line number Diff line change @@ -40,6 +40,16 @@ function(itlabai_link_externals target_name)
4040 target_link_libraries (${target_name} ${_scope} ${dep} )
4141 endif ()
4242 endforeach ()
43+ if (ext STREQUAL "openmp" AND OpenMP_FOUND)
44+ if (DEFINED OpenMP_CXX_FLAGS)
45+ string (REPLACE " " ";" _omp_flags "${OpenMP_CXX_FLAGS} " )
46+ target_compile_options (${target_name} ${_scope} ${_omp_flags} )
47+ endif ()
48+ if (DEFINED OpenMP_EXE_LINKER_FLAGS)
49+ string (REPLACE " " ";" _omp_lflags "${OpenMP_EXE_LINKER_FLAGS} " )
50+ target_link_options (${target_name} ${_scope} ${_omp_lflags} )
51+ endif ()
52+ endif ()
4353 if (TARGET ${ext} _external)
4454 add_dependencies (${target_name} ${ext} _external )
4555 endif ()
You can’t perform that action at this time.
0 commit comments