FindBLAS: Consider OpenBLAS with thread libraries only with C or CXX

The check added by commit 276b56f01c (FindBLAS: Add second try for
OpenBLAS with thread libraries., 2019-06-07, v3.15.0-rc2~5^2) can
work only when C or CXX is enabled.

Fixes: #20092
This commit is contained in:
Brad King 2019-12-12 12:09:06 -05:00
parent 2a5e5b25ba
commit d1e111d166

View File

@ -481,8 +481,12 @@ if (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
""
)
endif()
if(NOT BLAS_LIBRARIES)
find_package(Threads)
if(NOT BLAS_LIBRARIES AND (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED))
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads)
else()
find_package(Threads REQUIRED)
endif()
# OpenBLAS (http://www.openblas.net)
check_fortran_libraries(
BLAS_LIBRARIES