Skip to content

Commit

Permalink
cmake: Add shared library version. Resolves issue #63.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgates3 committed May 26, 2024
1 parent d390827 commit b852daa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ project(
LANGUAGES CXX
)

# See notes in GNUmakefile about using abi-compliance-checker.
# soversion is major ABI version.
set( abi_version 1.0.0 )
string( REPLACE "." ";" abi_list "${abi_version}" )
list( GET abi_list 0 soversion )

include( CheckCXXCompilerFlag )

# When built as a sub-project, add a namespace to make targets unique,
Expand Down Expand Up @@ -147,6 +153,8 @@ gpu_backend = ${gpu_backend}
use_openmp = ${use_openmp}
blaspp_is_project = ${blaspp_is_project}
blaspp_ = ${blaspp_}
abi_version = ${abi_version}
soversion = ${soversion}
" )

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -396,6 +404,8 @@ set_target_properties(
CXX_STANDARD_REQUIRED true # prohibit < c++17
CXX_EXTENSIONS false # prohibit gnu++17
WINDOWS_EXPORT_ALL_SYMBOLS ON
VERSION "${abi_version}"
SOVERSION "${soversion}"
)

if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
Expand Down

0 comments on commit b852daa

Please sign in to comment.