From 288d456c2951013e423ae4107f0207ef4594bb45 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 12 Oct 2020 12:24:08 +0100 Subject: 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 --- blas/CMakeLists.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'blas') diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt index 9887d5804..545bc989c 100644 --- a/blas/CMakeLists.txt +++ b/blas/CMakeLists.txt @@ -1,15 +1,13 @@ project(EigenBlas CXX) -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() +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) endif() add_custom_target(blas) -- cgit v1.2.3