Skip to content

Commit

Permalink
chore(meson): add rust-target option
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasmus Thomsen committed Jan 19, 2019
1 parent 175ce4a commit e09a3b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -39,6 +42,7 @@ custom_target('cargo-build-gxi',
'@OUTPUT@',
meson.current_build_dir(),
'gxi',
rust_target,
gxi_plugin_dir,
])

Expand All @@ -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']
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('rust-target', type : 'string', value : '', description : 'Has to be set to RUST_TARGET for cross compilation')
4 changes: 2 additions & 2 deletions scripts/cargo.sh
Original file line number Diff line number Diff line change
@@ -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
cargo build --manifest-path $1/Cargo.toml --target-dir $3 --release && cp $3/$5/release/$4 $2

0 comments on commit e09a3b7

Please sign in to comment.