Skip to content

Commit

Permalink
add option to install library to private directory
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
  • Loading branch information
stephanlachnit authored and DadSchoorse committed Jul 21, 2020
1 parent d6d4aea commit 7cd22a1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
9 changes: 7 additions & 2 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ data_dir = get_option('datadir')

vulkan_layer_dir = join_paths(data_dir, 'vulkan', 'implicit_layer.d')

install_data(['vkBasalt.json'],
install_dir: vulkan_layer_dir)
configure_file(
input : 'vkBasalt.json.in',
output : 'vkBasalt.json',
configuration : {'ld_lib_dir_vkbasalt' : ld_lib_dir_vkbasalt},
install : true,
install_dir : vulkan_layer_dir,
)
2 changes: 1 addition & 1 deletion config/vkBasalt.json → config/vkBasalt.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"layer" : {
"name": "VK_LAYER_VKBASALT_post_processing",
"type": "GLOBAL",
"library_path": "libvkbasalt.so",
"library_path": "@ld_lib_dir_vkbasalt@libvkbasalt.so",
"api_version": "1.2.136",
"implementation_version": "1",
"description": "a post processing layer",
Expand Down
8 changes: 8 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ project('vkBasalt', ['c', 'cpp'], default_options: ['c_std=c11', 'cpp_std=c++2a'

vkBasalt_include_path = include_directories('./include', './include/spirv')

lib_dir = get_option('libdir')
ld_lib_dir_vkbasalt = ''

if get_option('append_libdir_vkbasalt')
lib_dir = join_paths(lib_dir, 'vkbasalt')
ld_lib_dir_vkbasalt = get_option('prefix') + '/\$LIB/vkbasalt/'
endif

if get_option('with_so')
subdir('src')
endif
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
option('with_so', type : 'boolean', value : true, description : 'install the library')
option('with_json', type : 'boolean', value : true, description : 'install the json')
option('append_libdir_vkbasalt', type : 'boolean', value : false, description: 'Append "vkbasalt" to libdir path or not.')
2 changes: 0 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ vkBasalt_src = [

x11_dep = dependency('x11')

lib_dir = get_option('libdir')

shared_library(meson.project_name().to_lower(),
vkBasalt_src, shader_include,
include_directories : vkBasalt_include_path,
Expand Down

0 comments on commit 7cd22a1

Please sign in to comment.