Skip to content

Commit 0083f93

Browse files
committed
meson: add config_dir; option for creating config/log dirs
1 parent 7e0a520 commit 0083f93

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

meson.build

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ endif
4646
############
4747
# Variable #
4848
############
49-
config_dir = get_option('sysconfdir') / meson.project_name()
49+
config_dir = get_option('config_dir') / meson.project_name()
5050
log_dir = get_option('localstatedir') / 'log' / meson.project_name()
5151

5252
#####################
@@ -57,8 +57,12 @@ subdir('src')
5757
################
5858
# Config + Log #
5959
################
60-
install_emptydir(config_dir)
61-
install_emptydir(log_dir)
60+
if get_option('create_config_dir')
61+
install_emptydir(config_dir)
62+
endif
63+
if get_option('create_log_dir')
64+
install_emptydir(log_dir)
65+
endif
6266

6367
####################
6468
# Shell completion #

meson_options.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
option('boot_service', type : 'combo', choices : ['systemd', 'openrc'], value : 'systemd')
22
option('tests', type : 'boolean', value : false)
3+
option('config_dir', type : 'string', value : '/etc')
4+
option('create_config_dir', type : 'boolean', value : true)
5+
option('create_log_dir', type : 'boolean', value : true)

src/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ if get_option('tests')
8080
test_exe,
8181
timeout: 0
8282
)
83-
endif
83+
endif

0 commit comments

Comments
 (0)