diff --git a/meson.build b/meson.build index 9129944..15c90d5 100644 --- a/meson.build +++ b/meson.build @@ -28,6 +28,9 @@ grabber = find_program('scripts/grabber.sh') c = run_command(grabber) sources = c.stdout().strip().split('\n') +# Well this isn't pretty +rust_target = get_option('rust-target') + custom_target('cargo-build-gxi', input: sources, output: ['gxi'], @@ -39,6 +42,7 @@ custom_target('cargo-build-gxi', '@OUTPUT@', meson.current_build_dir(), 'gxi', + rust_target, gxi_plugin_dir, ]) @@ -58,6 +62,7 @@ custom_target('cargo-build-syntect', '@OUTPUT@', syntect_releasebin_path, 'xi-syntect-plugin', + rust_target, ]) synctect_assets = ['assets/Makefile.toml', 'assets/YAML.toml', 'manifest.toml'] diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..1ffe3ac --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('rust-target', type : 'string', value : '', description : 'Has to be set to RUST_TARGET for cross compilation') \ No newline at end of file diff --git a/scripts/cargo.sh b/scripts/cargo.sh index 1dc00a3..457377d 100755 --- a/scripts/cargo.sh +++ b/scripts/cargo.sh @@ -1,5 +1,5 @@ #!/bin/sh -export GXI_PLUGIN_DIR=$5 +export GXI_PLUGIN_DIR=$6 -cargo build --manifest-path $1/Cargo.toml --target-dir $3 --release && cp $3/release/$4 $2 \ No newline at end of file +cargo build --manifest-path $1/Cargo.toml --target-dir $3 --release && cp $3/$5/release/$4 $2 \ No newline at end of file