@@ -25,12 +25,22 @@ if(CMAKE_CUDA_COMPILER)
2525 enable_language (CUDA)
2626 find_package (CUDAToolkit REQUIRED)
2727 add_library (tensorarray_core SHARED ${TensorArray_Core_cc} ${TensorArray_Core_cu} )
28+ add_library (tensorarray_core_static STATIC ${TensorArray_Core_cc} ${TensorArray_Core_cu} )
29+
2830 set_property (TARGET tensorarray_core PROPERTY CUDA_STANDARD 17)
2931 set_property (TARGET tensorarray_core PROPERTY CUDA_STANDARD_REQUIRED ON )
3032 set_property (TARGET tensorarray_core PROPERTY CUDA_EXTENSIONS OFF )
3133 set_property (TARGET tensorarray_core PROPERTY CUDA_SEPARABLE_COMPILATION ON )
3234 target_include_directories (tensorarray_core PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:${CUDAToolkit_INCLUDE_DIRS} >)
3335 target_link_libraries (tensorarray_core PRIVATE $<$<LINK_LANGUAGE:C,CXX>:CUDA::cublas>)
36+
37+ set_property (TARGET tensorarray_core_static PROPERTY CUDA_STANDARD 17)
38+ set_property (TARGET tensorarray_core_static PROPERTY CUDA_STANDARD_REQUIRED ON )
39+ set_property (TARGET tensorarray_core_static PROPERTY CUDA_EXTENSIONS OFF )
40+ set_property (TARGET tensorarray_core_static PROPERTY CUDA_SEPARABLE_COMPILATION ON )
41+ target_include_directories (tensorarray_core_static PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:${CUDAToolkit_INCLUDE_DIRS} >)
42+ target_link_libraries (tensorarray_core_static PRIVATE $<$<LINK_LANGUAGE:C,CXX>:CUDA::cublas>)
43+
3444 if (MSVC )
3545 target_compile_definitions (tensorarray_core PRIVATE TENSOR_ARRAY_CORE_EXPORTS)
3646 endif ()
@@ -40,7 +50,8 @@ if(CMAKE_CUDA_COMPILER)
4050 # set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
4151 # list(APPEND CMAKE_CUDA_FLAGS "--default-stream per-thread")
4252else ()
43- add_library (tensorarray_core SHARED ${TensorArray_Core_cc} ${TensorArray_Core_cu} )
53+ add_library (tensorarray_core SHARED ${TensorArray_Core_cc} )
54+ add_library (tensorarray_core_static STATIC ${TensorArray_Core_cc} )
4455endif ()
4556
4657
@@ -54,6 +65,15 @@ set_property(TARGET tensorarray_core PROPERTY CXX_STANDARD 17)
5465set_property (TARGET tensorarray_core PROPERTY CXX_STANDARD_REQUIRED ON )
5566set_property (TARGET tensorarray_core PROPERTY CXX_EXTENSIONS OFF )
5667
68+
69+ set_property (TARGET tensorarray_core_static PROPERTY C_STANDARD 11)
70+ set_property (TARGET tensorarray_core_static PROPERTY C_STANDARD_REQUIRED ON )
71+ set_property (TARGET tensorarray_core_static PROPERTY C_EXTENSIONS OFF )
72+
73+ set_property (TARGET tensorarray_core_static PROPERTY CXX_STANDARD 17)
74+ set_property (TARGET tensorarray_core_static PROPERTY CXX_STANDARD_REQUIRED ON )
75+ set_property (TARGET tensorarray_core_static PROPERTY CXX_EXTENSIONS OFF )
76+
5777install (
5878 TARGETS tensorarray_core
5979 EXPORT TensorArrayTargets
@@ -65,4 +85,16 @@ install(
6585 COMPONENT Development
6686)
6787
68- add_library (TensorArray::Core ALIAS tensorarray_core)
88+ install (
89+ TARGETS tensorarray_core_static
90+ EXPORT TensorArrayTargets
91+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR} "
92+ COMPONENT Runtime
93+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR} /tensor-array"
94+ COMPONENT Runtime
95+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR} /${TensorArray_Core_Dir} "
96+ COMPONENT Development
97+ )
98+
99+ add_library (TensorArray::core ALIAS tensorarray_core)
100+ add_library (TensorArray::core_static ALIAS tensorarray_core_static)
0 commit comments