Link OpenMP clang+gfortran build with -lomp

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

View File

@ -43,6 +43,9 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "QNX")
target_link_libraries(x${float_char}cblat1 m)
endif()
if (USE_OPENMP AND CMAKE_Fortran_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_ID STREQUAL CLANG)
target_link_libraries(${test_bin} omp)
endif()
add_test(NAME "x${float_char}cblat1"
COMMAND $<TARGET_FILE:x${float_char}cblat1>)
@ -68,6 +71,9 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "QNX")
target_link_libraries(x${float_char}cblat2 m)
endif()
if (USE_OPENMP AND CMAKE_Fortran_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_ID STREQUAL CLANG)
target_link_libraries(${test_bin} omp)
endif()
add_test(NAME "x${float_char}cblat2"
COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat2> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in2")
@ -93,6 +99,9 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "QNX")
target_link_libraries(x${float_char}cblat3 m)
endif()
if (USE_OPENMP AND CMAKE_Fortran_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_ID STREQUAL CLANG)
target_link_libraries(${test_bin} omp)
endif()
add_test(NAME "x${float_char}cblat3"
COMMAND ${test_helper} $<TARGET_FILE:x${float_char}cblat3> "${PROJECT_SOURCE_DIR}/ctest/${float_char}in3")