Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions alvr/xtask/src/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::command;
use crate::{CommonBuildFlags, command};
use alvr_filesystem::{self as afs, Layout};
use std::{
env,
Expand Down Expand Up @@ -27,7 +27,11 @@ impl Display for Profile {
}
}

pub fn build_server_lib(profile: Profile, root: Option<String>, reproducible: bool) {
pub fn build_server_lib(
profile: Profile,
root: Option<String>,
common_build_flags: CommonBuildFlags,
) {
let sh = Shell::new().unwrap();

let mut flags = vec![];
Expand All @@ -39,9 +43,12 @@ pub fn build_server_lib(profile: Profile, root: Option<String>, reproducible: bo
Profile::Release => flags.push("--release"),
Profile::Debug => (),
}
if reproducible {
if common_build_flags.locked {
flags.push("--locked");
}
if common_build_flags.offline {
flags.push("--offline");
}
let flags_ref = &flags;

let artifacts_dir = afs::target_dir().join(profile.to_string());
Expand Down Expand Up @@ -75,8 +82,7 @@ pub fn build_streamer(
profile: Profile,
gpl: bool,
root: Option<String>,
reproducible: bool,
profiling: bool,
common_build_flags: CommonBuildFlags,
keep_config: bool,
) {
let sh = Shell::new().unwrap();
Expand All @@ -92,9 +98,15 @@ pub fn build_streamer(
Profile::Release => common_flags.push("--release"),
Profile::Debug => (),
}
if reproducible {
if common_build_flags.locked {
common_flags.push("--locked");
}
if common_build_flags.frozen {
common_flags.push("--frozen");
}
if common_build_flags.offline {
common_flags.push("--offline");
}

let artifacts_dir = if cfg!(all(windows, target_arch = "aarch64")) {
// Fix for cross compilation
Expand Down Expand Up @@ -136,7 +148,7 @@ pub fn build_streamer(
vec![]
};

let profiling_flag = if profiling {
let profiling_flag = if common_build_flags.profiling {
vec!["--features", "alvr_server_core/trace-performance"]
} else {
vec![]
Expand Down Expand Up @@ -273,7 +285,7 @@ pub fn build_streamer(
}
}

pub fn build_launcher(profile: Profile, reproducible: bool) {
pub fn build_launcher(profile: Profile, common_build_flags: CommonBuildFlags) {
let sh = Shell::new().unwrap();

let mut common_flags = vec![];
Expand All @@ -285,9 +297,12 @@ pub fn build_launcher(profile: Profile, reproducible: bool) {
Profile::Release => common_flags.push("--release"),
Profile::Debug => (),
}
if reproducible {
if common_build_flags.locked {
common_flags.push("--locked");
}
if common_build_flags.offline {
common_flags.push("--offline");
}
let common_flags_ref = &common_flags;

sh.create_dir(afs::launcher_build_dir()).unwrap();
Expand Down
Loading
Loading