mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Replace language_support module with builtin CheckLanguage
The workaround_9220 function was introduced a long time ago to workaround a CMake issue with enable_language(OPTIONAL). Since then CMake has clarified that the OPTIONAL keywords has not been implemented[0]. A CheckLanguage module is now provided with CMake to check if a language can be enabled. Use that instead. [0] https://cmake.org/cmake/help/v3.18/command/enable_language.html
This commit is contained in:
@@ -5,18 +5,13 @@ if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h)
|
||||
endif()
|
||||
|
||||
# check if we have a Fortran compiler
|
||||
include("../cmake/language_support.cmake")
|
||||
|
||||
workaround_9220(Fortran EIGEN_Fortran_COMPILER_WORKS)
|
||||
|
||||
if(EIGEN_Fortran_COMPILER_WORKS)
|
||||
enable_language(Fortran OPTIONAL)
|
||||
if(NOT CMAKE_Fortran_COMPILER)
|
||||
set(EIGEN_Fortran_COMPILER_WORKS OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT EIGEN_Fortran_COMPILER_WORKS)
|
||||
include(CheckLanguage)
|
||||
check_language(Fortran)
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
enable_language(Fortran)
|
||||
set(EIGEN_Fortran_COMPILER_WORKS ON)
|
||||
else()
|
||||
set(EIGEN_Fortran_COMPILER_WORKS OFF)
|
||||
# search for a default Lapack library to complete Eigen's one
|
||||
find_package(LAPACK QUIET)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user