void-packages/srcpkgs/lapack/patches/cmake-make-both-static-shared.patch
2020-02-18 19:25:04 +01:00

116 lines
3.4 KiB
Diff

diff --git BLAS/SRC/CMakeLists.txt BLAS/SRC/CMakeLists.txt
index 41c48043..e3776ecd 100644
--- BLAS/SRC/CMakeLists.txt
+++ BLAS/SRC/CMakeLists.txt
@@ -98,9 +98,15 @@ endif()
list(REMOVE_DUPLICATES SOURCES)
add_library(blas ${SOURCES})
+add_library(blas_static STATIC ${SOURCES})
set_target_properties(
blas PROPERTIES
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
)
+set_target_properties(
+ blas_static PROPERTIES
+ OUTPUT_NAME blas
+ )
lapack_install_library(blas)
+lapack_install_library(blas_static)
diff --git CBLAS/src/CMakeLists.txt CBLAS/src/CMakeLists.txt
index 90e19f81..b97d64d7 100644
--- CBLAS/src/CMakeLists.txt
+++ CBLAS/src/CMakeLists.txt
@@ -114,15 +114,22 @@ endif()
list(REMOVE_DUPLICATES SOURCES)
add_library(cblas ${SOURCES})
+add_library(cblas_static STATIC ${SOURCES})
set_target_properties(
cblas PROPERTIES
LINKER_LANGUAGE C
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
)
+set_target_properties(
+ cblas_static PROPERTIES
+ OUTPUT_NAME cblas
+ )
target_include_directories(cblas PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(cblas PRIVATE ${BLAS_LIBRARIES})
+target_link_libraries(cblas_static PRIVATE ${BLAS_LIBRARIES})
lapack_install_library(cblas)
+lapack_install_library(cblas_static)
diff --git LAPACKE/CMakeLists.txt LAPACKE/CMakeLists.txt
index 0589a74b..be63bba3 100644
--- LAPACKE/CMakeLists.txt
+++ LAPACKE/CMakeLists.txt
@@ -73,12 +73,17 @@ endif()
list(APPEND SOURCES ${UTILS})
add_library(lapacke ${SOURCES})
+add_library(lapacke_static STATIC ${SOURCES})
set_target_properties(
lapacke PROPERTIES
LINKER_LANGUAGE C
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
)
+set_target_properties(
+ lapacke_static PROPERTIES
+ OUTPUT_NAME lapacke
+ )
target_include_directories(lapacke PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
@@ -90,10 +95,13 @@ endif()
if(LAPACKE_WITH_TMG)
target_link_libraries(lapacke PRIVATE tmglib)
+ target_link_libraries(lapacke_static PRIVATE tmglib)
endif()
target_link_libraries(lapacke PRIVATE ${LAPACK_LIBRARIES})
+target_link_libraries(lapacke_static PRIVATE ${LAPACK_LIBRARIES})
lapack_install_library(lapacke)
+lapack_install_library(lapacke_static)
install(
FILES ${LAPACKE_INCLUDE} ${LAPACK_BINARY_DIR}/include/lapacke_mangling.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
diff --git SRC/CMakeLists.txt SRC/CMakeLists.txt
index f19bdd30..7a9a0661 100644
--- SRC/CMakeLists.txt
+++ SRC/CMakeLists.txt
@@ -501,16 +501,23 @@ endif()
list(REMOVE_DUPLICATES SOURCES)
add_library(lapack ${SOURCES})
+add_library(lapack_static STATIC ${SOURCES})
set_target_properties(
lapack PROPERTIES
VERSION ${LAPACK_VERSION}
SOVERSION ${LAPACK_MAJOR_VERSION}
)
+set_target_properties(
+ lapack_static PROPERTIES
+ OUTPUT_NAME lapack
+ )
if(USE_XBLAS)
target_link_libraries(lapack PRIVATE ${XBLAS_LIBRARY})
+ target_link_libraries(lapack_static PRIVATE ${XBLAS_LIBRARY})
endif()
target_link_libraries(lapack PRIVATE ${BLAS_LIBRARIES})
+target_link_libraries(lapack_static PRIVATE ${BLAS_LIBRARIES})
if(_is_coverage_build)
target_link_libraries(lapack PRIVATE gcov)
@@ -518,3 +525,4 @@ if(_is_coverage_build)
endif()
lapack_install_library(lapack)
+lapack_install_library(lapack_static)