mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Do not build shared libs if not supported
(cherry picked from commit 09d7122468)
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
4240b480e0
commit
1e9f623f3e
@@ -26,20 +26,27 @@ else()
|
||||
set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
|
||||
endif()
|
||||
|
||||
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
||||
add_library(eigen_blas SHARED ${EigenBlas_SRCS})
|
||||
set(EIGEN_BLAS_TARGETS "")
|
||||
|
||||
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})
|
||||
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
||||
list(APPEND EIGEN_BLAS_TARGETS eigen_blas_static)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user