Link OpenMP clang+gfortran builds with libomp

This commit is contained in:
Martin Kroeker 2024-02-16 15:41:46 +01:00 committed by GitHub
parent 42d35f1084
commit ba4ea7bb07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,13 @@ endif()
foreach(test_bin ${OpenBLAS_Tests})
add_executable(${test_bin} ${test_bin}.f)
target_link_libraries(${test_bin} ${OpenBLAS_LIBNAME})
if (USE_OPENMP)
if (CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
if (CMAKE_C_COMPILER_ID STREQUAL CLANG)
target_link_libraries(${test_bin} omp)
endif()
endif()
endif()
endforeach()
# $1 exec, $2 input, $3 output_result