diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2022-07-02 18:48:10 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2022-07-02 19:01:18 +0100 |
commit | 6ae5623674d5c5ab7e83c6d3aa742081212748fc (patch) | |
tree | 750b3c0c1bfb045a2267f2853af2fbd18b203a2d /meson.build | |
parent | 66fa47c6f16b0072d686d680abf984872a84d1b7 (diff) |
meson: add 'cache-dir' option
Fixes #244
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 1c01b63..ac02568 100644 --- a/meson.build +++ b/meson.build @@ -266,10 +266,16 @@ endforeach conf.set_quoted('FC_FONTPATH', escaped_xml_path) fonts_conf.set('FC_FONTPATH', xml_path) -if host_machine.system() == 'windows' - fc_cachedir = 'LOCAL_APPDATA_FONTCONFIG_CACHE' -else - fc_cachedir = join_paths(prefix, get_option('localstatedir'), 'cache', meson.project_name()) +fc_cachedir = get_option('cache-dir') +if fc_cachedir in ['yes', 'no', 'default'] + if host_machine.system() == 'windows' + fc_cachedir = 'LOCAL_APPDATA_FONTCONFIG_CACHE' + else + fc_cachedir = join_paths(prefix, get_option('localstatedir'), 'cache', meson.project_name()) + endif +endif + +if host_machine.system() != 'windows' thread_dep = dependency('threads') conf.set('HAVE_PTHREAD', 1) deps += [thread_dep] @@ -436,3 +442,6 @@ summary({ 'Font directories': fc_fonts_paths, 'Additional font directories': fc_add_fonts, }, section: 'Defaults', bool_yn: true, list_sep: ', ') +summary({ + 'Cache directory': fc_cachedir, + }, section: 'Paths', bool_yn: true, list_sep: ', ') |