From 27a5f00ea426e18541b10b013f2cd9e8cbd913b5 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sat, 14 May 2022 20:02:34 +0200 Subject: [PATCH] More tweaks to the install target When you code, you should probably configure with -Dscript_path=$HOME/your/code/dir, and doing this now prevents the script files from being copied over to the install dir. This is correct because in this case source dir == dest dir. If you want to really install the program, you should set script_path to a relative path or a different directory than the source. For example -Dscript_path=duckticker/script. ninja install will copy the script files to the install directory in this case. Note that the path to the script directory that gets compiled into the binary is an absolute path in either case. This means that "roaming app" mode is not currently supported. The reason for this is that I need code to detect the binary directory so that relative script paths can work, but I don't have that code right now. --- meson.build | 7 ++++--- subprojects/wrenpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index c789e82..847a1ed 100644 --- a/meson.build +++ b/meson.build @@ -8,6 +8,7 @@ project('duckticker', 'cpp', compiler_opts = ['-DWRENPP_WITH_NAME_GUESSING'] full_data_dir = get_option('prefix') / get_option('datadir') +full_script_dir = full_data_dir / get_option('script_path') / '' global_config = configuration_data() global_config.set_quoted('PROJECT_NAME', meson.project_name()) @@ -15,10 +16,10 @@ version_arr = meson.project_version().split('.') global_config.set('PROJECT_VERSION_MAJOR', version_arr[0]) global_config.set('PROJECT_VERSION_MINOR', version_arr[1]) global_config.set('PROJECT_VERSION_PATCH', version_arr[2]) -global_config.set_quoted('SCRIPT_PATH', full_data_dir / get_option('script_path') / '') +global_config.set_quoted('SCRIPT_PATH', full_script_dir) subdir('src') -if meson.project_source_root() != full_data_dir - install_data(sources: 'script/main.wren', install_dir: full_data_dir) +if not get_option('script_path').startswith(meson.project_source_root()) + install_data(sources: 'script/main.wren', install_dir: get_option('script_path')) endif diff --git a/subprojects/wrenpp b/subprojects/wrenpp index 036dd57..d3ad818 160000 --- a/subprojects/wrenpp +++ b/subprojects/wrenpp @@ -1 +1 @@ -Subproject commit 036dd57524083f9d196f06a553aaeaaf1a17492d +Subproject commit d3ad818b8e7654fc2f3ff5d58880842db54af1ea