mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 03:09:01 +08:00
Do not build shared libs if not supported
This commit is contained in:
parent
a5a7faeb45
commit
09d7122468
@ -88,6 +88,9 @@ else()
|
|||||||
ei_add_cxx_compiler_flag("-std=c++03")
|
ei_add_cxx_compiler_flag("-std=c++03")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Determine if we should build shared libraries on this platform.
|
||||||
|
get_cmake_property(EIGEN_BUILD_SHARED_LIBS TARGET_SUPPORTS_SHARED_LIBS)
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# find how to link to the standard libraries #
|
# find how to link to the standard libraries #
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
@ -26,20 +26,27 @@ else()
|
|||||||
set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
|
set(EigenBlas_SRCS ${EigenBlas_SRCS} f2c/complexdots.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
set(EIGEN_BLAS_TARGETS "")
|
||||||
add_library(eigen_blas SHARED ${EigenBlas_SRCS})
|
|
||||||
|
|
||||||
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
add_library(eigen_blas_static ${EigenBlas_SRCS})
|
||||||
target_link_libraries(eigen_blas_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
list(APPEND EIGEN_BLAS_TARGETS eigen_blas_static)
|
||||||
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()
|
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
|
add_dependencies(blas ${target})
|
||||||
RUNTIME DESTINATION bin
|
install(TARGETS ${target}
|
||||||
LIBRARY DESTINATION lib
|
RUNTIME DESTINATION bin
|
||||||
ARCHIVE DESTINATION lib)
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if(EIGEN_Fortran_COMPILER_WORKS)
|
if(EIGEN_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
|
@ -88,25 +88,29 @@ endif()
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(EIGEN_LAPACK_TARGETS "")
|
||||||
|
|
||||||
add_library(eigen_lapack_static ${EigenLapack_SRCS} ${ReferenceLapack_SRCS})
|
add_library(eigen_lapack_static ${EigenLapack_SRCS} ${ReferenceLapack_SRCS})
|
||||||
add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
|
list(APPEND EIGEN_LAPACK_TARGETS eigen_lapack_static)
|
||||||
|
|
||||||
target_link_libraries(eigen_lapack eigen_blas)
|
if (EIGEN_BUILD_SHARED_LIBS)
|
||||||
|
add_library(eigen_lapack SHARED ${EigenLapack_SRCS})
|
||||||
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
list(APPEND EIGEN_LAPACK_TARGETS eigen_lapack)
|
||||||
target_link_libraries(eigen_lapack_static ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
target_link_libraries(eigen_lapack eigen_blas)
|
||||||
target_link_libraries(eigen_lapack ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_dependencies(lapack eigen_lapack eigen_lapack_static)
|
foreach(target IN LISTS EIGEN_LAPACK_TARGETS)
|
||||||
|
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
||||||
|
target_link_libraries(${target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
||||||
|
endif()
|
||||||
|
add_dependencies(lapack ${target})
|
||||||
|
install(TARGETS ${target}
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
install(TARGETS eigen_lapack eigen_lapack_static
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
LIBRARY DESTINATION lib
|
|
||||||
ARCHIVE DESTINATION lib)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
get_filename_component(eigen_full_path_to_testing_lapack "./testing/" ABSOLUTE)
|
get_filename_component(eigen_full_path_to_testing_lapack "./testing/" ABSOLUTE)
|
||||||
if(EXISTS ${eigen_full_path_to_testing_lapack})
|
if(EXISTS ${eigen_full_path_to_testing_lapack})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user