Skip to content

Commit e52096b

Browse files
dvrogozhgfxbot
authored andcommitted
Build dynamic library with a linux-qualified name
Fixes: #28 By convention on Linux if library is going to be linked against it should have: * real name, which is usually libigdgmm.so.x.y.z, x.y.z is a library version * soname which is libigdgmm.so.x, usually that's a symbolic link to real name * linker name which is libigdgmm.so, usually that's a symbolic link to soname Building library without the above convention is applicable only if library is supposed to be dlopen(), i.e. for drivers and similar things. Since gmmlib will be linked against rahter than dlopen-ed it should qualify to the above Linux convention. This fix makes exactly that. CMake will automatically create required symbolc links (soname and linker name). This commit also bumps up the version of gmmlib. Change-Id: I55f4bc30ba4e556a5cf6ac61609aa70939a9bdfc Signed-off-by: Dmitry Rogozhkin <[email protected]>
1 parent 5b61c8a commit e52096b

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Source/GmmLib/CMakeLists.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@
2222

2323
cmake_minimum_required(VERSION 3.5)
2424
project(igfx_gmmumd)
25+
if(NOT DEFINED MAJOR_VERSION)
26+
set(MAJOR_VERSION 1)
27+
endif()
28+
29+
if(NOT DEFINED MINOR_VERSION)
30+
set(MINOR_VERSION 0)
31+
endif()
32+
33+
if(NOT DEFINED PATCH_VERSION)
34+
set(PATCH_VERSION 0)
35+
endif()
36+
2537
if(NOT DEFINED BS_USE_OSDM_BUILD_SYSTEM)
2638
if(DEFINED ENV{BS_USE_OSDM_BUILD_SYSTEM})
2739
set(BS_USE_OSDM_BUILD_SYSTEM "$ENV{BS_USE_OSDM_BUILD_SYSTEM}")
@@ -397,6 +409,8 @@ target_link_libraries( ${GMM_LIB_DLL_NAME}
397409
)
398410
else()
399411
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES OUTPUT_NAME "igdgmm")
412+
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
413+
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES SOVERSION ${MAJOR_VERSION})
400414

401415
endif()
402416

@@ -527,18 +541,6 @@ endif()
527541
if(UNIX)
528542
include(GNUInstallDirs)
529543

530-
if(NOT DEFINED MAJOR_VERSION)
531-
set(MAJOR_VERSION 0)
532-
endif()
533-
534-
if(NOT DEFINED MINOR_VERSION)
535-
set(MINOR_VERSION 1)
536-
endif()
537-
538-
if(NOT DEFINED PATCH_VERSION)
539-
set(PATCH_VERSION 0)
540-
endif()
541-
542544
configure_file(${BS_DIR_GMMLIB}/igdgmm.h.in ${CMAKE_BINARY_DIR}/igdgmm.h)
543545
configure_file(${BS_DIR_GMMLIB}/igdgmm.pc.in ${CMAKE_BINARY_DIR}/igdgmm.pc @ONLY)
544546

0 commit comments

Comments
 (0)