diff options
author | Yi Kong <yikong@google.com> | 2022-02-25 16:32:14 +0800 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2022-02-25 15:08:55 +0000 |
commit | 2aab794c004027d008d6b0b64165bf1961d5d2bb (patch) | |
tree | 83bb8f19c67bcafdb2ca4a98414af1b17392ec36 /blas/CMakeLists.txt | |
parent | ca5aa72016f062fd0712bcb86370478de332bca3 (diff) | |
download | eigen-2aab794c004027d008d6b0b64165bf1961d5d2bb.tar.gz |
Upgrade eigen to 3.4.0
Steps:
* Removed common files between Android copy and the matching upstream copy
* Obtained latest upstream tarball (see README.version)
* Extracted over the directory
Bug: 148287349
Test: presubmit
Change-Id: Iee2744719075fdf000b315e973645923da766111
Diffstat (limited to 'blas/CMakeLists.txt')
-rw-r--r-- | blas/CMakeLists.txt | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/blas/CMakeLists.txt b/blas/CMakeLists.txt index d0efb4188..f3a94ec4a 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) @@ -28,27 +26,36 @@ else() set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c) endif() +set(EIGEN_BLAS_TARGETS "") + add_library(eigen_blas_static ${EigenBlas_SRCS}) -add_library(eigen_blas SHARED ${EigenBlas_SRCS}) +list(APPEND EIGEN_BLAS_TARGETS eigen_blas_static) -if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) - target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) - target_link_libraries(eigen_blas ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) +if (EIGEN_BUILD_SHARED_LIBS) + add_library(eigen_blas SHARED ${EigenBlas_SRCS}) + list(APPEND EIGEN_BLAS_TARGETS eigen_blas) endif() -add_dependencies(blas eigen_blas eigen_blas_static) +foreach(target IN LISTS EIGEN_BLAS_TARGETS) + if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) + target_link_libraries(${target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) + endif() -install(TARGETS eigen_blas eigen_blas_static - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + add_dependencies(blas ${target}) + install(TARGETS ${target} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) +endforeach() if(EIGEN_Fortran_COMPILER_WORKS) -if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) - add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest -else() - add_subdirectory(testing EXCLUDE_FROM_ALL) +if(BUILD_TESTING) + if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) + add_subdirectory(testing) # can't do EXCLUDE_FROM_ALL here, breaks CTest + else() + add_subdirectory(testing EXCLUDE_FROM_ALL) + endif() endif() endif() |