Skip to content

Commit cfa95e2

Browse files
committed
Build dynamic library with a linux-qualified name
Fixes: intel#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. Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
1 parent 5b61c8a commit cfa95e2

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

Source/GmmLib/CMakeLists.txt

+15-13
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@
2222

2323
cmake_minimum_required(VERSION 3.5)
2424
project(igfx_gmmumd)
25+
26+
if(NOT DEFINED MAJOR_VERSION)
27+
set(MAJOR_VERSION 1)
28+
endif()
29+
30+
if(NOT DEFINED MINOR_VERSION)
31+
set(MINOR_VERSION 0)
32+
endif()
33+
34+
if(NOT DEFINED PATCH_VERSION)
35+
set(PATCH_VERSION 0)
36+
endif()
37+
2538
if(NOT DEFINED BS_USE_OSDM_BUILD_SYSTEM)
2639
if(DEFINED ENV{BS_USE_OSDM_BUILD_SYSTEM})
2740
set(BS_USE_OSDM_BUILD_SYSTEM "$ENV{BS_USE_OSDM_BUILD_SYSTEM}")
@@ -397,7 +410,8 @@ target_link_libraries( ${GMM_LIB_DLL_NAME}
397410
)
398411
else()
399412
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES OUTPUT_NAME "igdgmm")
400-
413+
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
414+
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES SOVERSION ${MAJOR_VERSION})
401415
endif()
402416

403417

@@ -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)