Skip to content

Commit

Permalink
Build dynamic library with a linux-qualified name
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dvrogozh authored and gfxbot committed Sep 28, 2018
1 parent 5b61c8a commit e52096b
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions Source/GmmLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@

cmake_minimum_required(VERSION 3.5)
project(igfx_gmmumd)
if(NOT DEFINED MAJOR_VERSION)
set(MAJOR_VERSION 1)
endif()

if(NOT DEFINED MINOR_VERSION)
set(MINOR_VERSION 0)
endif()

if(NOT DEFINED PATCH_VERSION)
set(PATCH_VERSION 0)
endif()

if(NOT DEFINED BS_USE_OSDM_BUILD_SYSTEM)
if(DEFINED ENV{BS_USE_OSDM_BUILD_SYSTEM})
set(BS_USE_OSDM_BUILD_SYSTEM "$ENV{BS_USE_OSDM_BUILD_SYSTEM}")
Expand Down Expand Up @@ -397,6 +409,8 @@ target_link_libraries( ${GMM_LIB_DLL_NAME}
)
else()
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES OUTPUT_NAME "igdgmm")
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
set_target_properties(${GMM_LIB_DLL_NAME} PROPERTIES SOVERSION ${MAJOR_VERSION})

endif()

Expand Down Expand Up @@ -527,18 +541,6 @@ endif()
if(UNIX)
include(GNUInstallDirs)

if(NOT DEFINED MAJOR_VERSION)
set(MAJOR_VERSION 0)
endif()

if(NOT DEFINED MINOR_VERSION)
set(MINOR_VERSION 1)
endif()

if(NOT DEFINED PATCH_VERSION)
set(PATCH_VERSION 0)
endif()

configure_file(${BS_DIR_GMMLIB}/igdgmm.h.in ${CMAKE_BINARY_DIR}/igdgmm.h)
configure_file(${BS_DIR_GMMLIB}/igdgmm.pc.in ${CMAKE_BINARY_DIR}/igdgmm.pc @ONLY)

Expand Down

0 comments on commit e52096b

Please sign in to comment.