Fix issues with the meson build
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
pub const APP_ID: &str = "com.lemmy-gtk.lemoa";
|
||||
pub const APP_ID: &str = "com.lemmygtk.lemoa";
|
||||
pub const PKGDATADIR: &str = "/usr/local/share/lemoa";
|
||||
pub const VERSION: &str = "0.1.0";
|
||||
|
||||
@@ -2,14 +2,16 @@
|
||||
conf = configuration_data()
|
||||
conf.set_quoted('APP_ID', application_id)
|
||||
conf.set_quoted('PKGDATADIR', pkgdatadir)
|
||||
conf.set_quoted('VERSION', version)
|
||||
conf.set_quoted('VERSION', version + version_suffix)
|
||||
|
||||
# Update the application config info
|
||||
configure_file(
|
||||
input: 'config.rs.in',
|
||||
output: 'config.rs',
|
||||
configuration: conf
|
||||
)
|
||||
|
||||
# copy the config info into the project
|
||||
run_command(
|
||||
'cp',
|
||||
join_paths(meson.project_build_root(), 'src', 'config.rs'),
|
||||
@@ -20,10 +22,21 @@ run_command(
|
||||
# Setup cargo
|
||||
cargo = find_program('cargo')
|
||||
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
|
||||
|
||||
cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
|
||||
cargo_options += [ '--target-dir', meson.project_build_root() / 'target' ]
|
||||
cargo_options += [ '--release' ]
|
||||
|
||||
# If the profile is development, build as debug, otherwise release
|
||||
if get_option('profile') == 'default'
|
||||
cargo_options += [ '--release' ]
|
||||
rust_target = 'release'
|
||||
message('Building in release mode')
|
||||
else
|
||||
rust_target = 'debug'
|
||||
message('Building in debug mode')
|
||||
endif
|
||||
|
||||
# Build the actual package
|
||||
cargo_release = custom_target(
|
||||
'cargo-build',
|
||||
build_by_default: true,
|
||||
@@ -38,7 +51,6 @@ cargo_release = custom_target(
|
||||
cargo, 'build',
|
||||
cargo_options,
|
||||
'&&',
|
||||
'cp', 'target' / 'release' / meson.project_name(), '@OUTPUT@',
|
||||
'cp', 'target' / rust_target / meson.project_name(), '@OUTPUT@',
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user