| @@ -1,28 +1,28 @@ | | | @@ -1,28 +1,28 @@ |
1 | $NetBSD: patch-SRC_CMakeLists.txt,v 1.2 2021/05/12 14:32:51 thor Exp $ | | 1 | $NetBSD: patch-SRC_CMakeLists.txt,v 1.3 2021/06/01 22:13:35 thor Exp $ |
2 | | | 2 | |
3 | Support combined build of shared and static libraries. | | 3 | Support combined build of shared and static libraries. |
4 | | | 4 | |
5 | --- SRC/CMakeLists.txt.orig 2021-03-25 18:25:15.000000000 +0000 | | 5 | --- SRC/CMakeLists.txt.orig 2021-03-25 18:25:15.000000000 +0000 |
6 | +++ SRC/CMakeLists.txt | | 6 | +++ SRC/CMakeLists.txt |
7 | @@ -518,3 +518,23 @@ if(_is_coverage_build) | | 7 | @@ -518,3 +518,23 @@ if(_is_coverage_build) |
8 | endif() | | 8 | endif() |
9 | | | 9 | |
10 | lapack_install_library(${LAPACKLIB}) | | 10 | lapack_install_library(${LAPACKLIB}) |
11 | +if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) | | 11 | +if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) |
12 | + add_library(${LAPACKLIB}_static STATIC ${SOURCES}) | | 12 | + add_library(${LAPACKLIB}_static STATIC ${SOURCES}) |
13 | + set_target_properties( | | 13 | + set_target_properties( |
14 | + ${LAPACKLIB}_static PROPERTIES | | 14 | + ${LAPACKLIB}_static PROPERTIES |
15 | + OUTPUT_NAME lapack | | 15 | + OUTPUT_NAME ${LAPACKLIB} |
16 | + ) | | 16 | + ) |
17 | + | | 17 | + |
18 | + if(USE_XBLAS) | | 18 | + if(USE_XBLAS) |
19 | + target_link_libraries(${LAPACKLIB}_static PRIVATE ${XBLAS_LIBRARY}) | | 19 | + target_link_libraries(${LAPACKLIB}_static PRIVATE ${XBLAS_LIBRARY}) |
20 | + endif() | | 20 | + endif() |
21 | + target_link_libraries(${LAPACKLIB}_static PRIVATE ${BLAS_LIBRARIES}) | | 21 | + target_link_libraries(${LAPACKLIB}_static PRIVATE ${BLAS_LIBRARIES}) |
22 | + | | 22 | + |
23 | + if (_is_coverage_build) | | 23 | + if (_is_coverage_build) |
24 | + target_link_libraries(${LAPACKLIB}_static PRIVATE gcov) | | 24 | + target_link_libraries(${LAPACKLIB}_static PRIVATE gcov) |
25 | + add_coverage(${LAPACKLIB}_static) | | 25 | + add_coverage(${LAPACKLIB}_static) |
26 | + endif() | | 26 | + endif() |
27 | + | | 27 | + |
28 | + lapack_install_library(${LAPACKLIB}_static) | | 28 | + lapack_install_library(${LAPACKLIB}_static) |