Messing around with --datadir, cleaning meson.build a bit

To run the binary while debugging you should now configure
with -Dscript_path=$HOME/your/source/dir
This commit is contained in:
King_DuckZ 2022-05-14 19:33:22 +02:00
parent 1090ea8295
commit 8ce0e362bb

View file

@ -7,17 +7,18 @@ project('duckticker', 'cpp',
compiler_opts = ['-DWRENPP_WITH_NAME_GUESSING'] compiler_opts = ['-DWRENPP_WITH_NAME_GUESSING']
full_data_dir = get_option('prefix') / get_option('datadir')
global_config = configuration_data() global_config = configuration_data()
global_config.set_quoted('PROJECT_NAME', meson.project_name()) global_config.set_quoted('PROJECT_NAME', meson.project_name())
version_arr = meson.project_version().split('.') version_arr = meson.project_version().split('.')
global_config.set('PROJECT_VERSION_MAJOR', version_arr[0]) global_config.set('PROJECT_VERSION_MAJOR', version_arr[0])
global_config.set('PROJECT_VERSION_MINOR', version_arr[1]) global_config.set('PROJECT_VERSION_MINOR', version_arr[1])
global_config.set('PROJECT_VERSION_PATCH', version_arr[2]) global_config.set('PROJECT_VERSION_PATCH', version_arr[2])
global_config.set_quoted('SCRIPT_PATH', get_option('prefix') / get_option('script_path') / '') global_config.set_quoted('SCRIPT_PATH', full_data_dir / get_option('script_path') / '')
subdir('src') subdir('src')
#full_config_dir = get_option('prefix') / get_option('sysconfdir') if meson.project_source_root() != full_data_dir
#if meson.source_root() != full_config_dir install_data(sources: 'script/main.wren', install_dir: full_data_dir)
# install_data(sources: meson.project_name() + '.conf', install_dir: full_config_dir) endif
#endif