feat: remove build with debug symbols functionality (always build release with debug symbols)

This commit is contained in:
Gabriele Musco 2024-02-04 13:13:50 +01:00
parent c550348a60
commit 773c4e1c06
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE
8 changed files with 19 additions and 83 deletions

View file

@ -28,7 +28,7 @@ pub fn get_build_basalt_jobs(profile: &Profile, clean_build: bool) -> VecDeque<W
let build_dir = format!("{}/build", profile.features.basalt.path.as_ref().unwrap());
let mut cmake_vars: HashMap<String, String> = HashMap::new();
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "Release".into());
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "RelWithDebInfo".into());
cmake_vars.insert("CMAKE_INSTALL_PREFIX".into(), profile.prefix.clone());
cmake_vars.insert("BUILD_TESTS".into(), "OFF".into());
cmake_vars.insert("BASALT_INSTANTIATIONS_DOUBLE".into(), "OFF".into());

View file

@ -31,7 +31,7 @@ pub fn get_build_libsurvive_jobs(profile: &Profile, clean_build: bool) -> VecDeq
profile.features.libsurvive.path.as_ref().unwrap()
);
let mut cmake_vars: HashMap<String, String> = HashMap::new();
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "Release".into());
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "RelWithDebInfo".into());
cmake_vars.insert("ENABLE_api_example".into(), "OFF".into());
cmake_vars.insert("USE_HIDAPI".into(), "ON".into());
cmake_vars.insert("CMAKE_SKIP_INSTALL_RPATH".into(), "YES".into());

View file

@ -9,11 +9,7 @@ use std::{
path::Path,
};
pub fn get_build_monado_jobs(
profile: &Profile,
clean_build: bool,
debug_build: bool,
) -> VecDeque<WorkerJob> {
pub fn get_build_monado_jobs(profile: &Profile, clean_build: bool) -> VecDeque<WorkerJob> {
let mut jobs = VecDeque::<WorkerJob>::new();
let git = Git {
@ -37,36 +33,17 @@ pub fn get_build_monado_jobs(
format!("{}/lib/pkgconfig", profile.prefix),
);
let mut cmake_vars: HashMap<String, String> = HashMap::new();
cmake_vars.insert(
"CMAKE_BUILD_TYPE".into(),
(if debug_build { "Debug" } else { "Release" }).into(),
);
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "RelWithDebInfo".into());
cmake_vars.insert("XRT_HAVE_SYSTEM_CJSON".into(), "NO".into());
cmake_vars.insert("CMAKE_LIBDIR".into(), format!("{}/lib", profile.prefix));
cmake_vars.insert("CMAKE_INSTALL_PREFIX".into(), profile.prefix.clone());
cmake_vars.insert(
"CMAKE_C_FLAGS".into(),
format!(
"-Wl,-rpath='{}/lib'{}",
profile.prefix,
if debug_build {
" -g -march=native -O3 -fno-omit-frame-pointer"
} else {
""
}
),
format!("-Wl,-rpath='{}/lib'", profile.prefix,),
);
cmake_vars.insert(
"CMAKE_CXX_FLAGS".into(),
format!(
"-Wl,-rpath='{}/lib'{}",
profile.prefix,
if debug_build {
" -g -march=native -O3 -fno-omit-frame-pointer"
} else {
""
}
),
format!("-Wl,-rpath='{}/lib'", profile.prefix,),
);
profile.xrservice_cmake_flags.iter().for_each(|(k, v)| {
if k == "CMAKE_C_FLAGS" || k == "CMAKE_CXX_FLAGS" {

View file

@ -9,11 +9,7 @@ use std::{
path::Path,
};
pub fn get_build_opencomposite_jobs(
profile: &Profile,
clean_build: bool,
debug_build: bool,
) -> VecDeque<WorkerJob> {
pub fn get_build_opencomposite_jobs(profile: &Profile, clean_build: bool) -> VecDeque<WorkerJob> {
let mut jobs = VecDeque::<WorkerJob>::new();
let git = Git {
@ -32,10 +28,7 @@ pub fn get_build_opencomposite_jobs(
let build_dir = format!("{}/build", profile.opencomposite_path);
let mut cmake_vars: HashMap<String, String> = HashMap::new();
cmake_vars.insert(
"CMAKE_BUILD_TYPE".into(),
(if debug_build { "Debug" } else { "Release" }).into(),
);
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "RelWithDebInfo".into());
let cmake = Cmake {
env: None,
vars: Some(cmake_vars),

View file

@ -28,7 +28,7 @@ pub fn get_build_openhmd_jobs(profile: &Profile, clean_build: bool) -> VecDeque<
let build_dir = format!("{}/build", profile.features.openhmd.path.as_ref().unwrap());
let mut cmake_vars: HashMap<String, String> = HashMap::new();
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "Release".into());
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "RelWithDebInfo".into());
cmake_vars.insert("CMAKE_INSTALL_PREFIX".into(), profile.prefix.clone());
cmake_vars.insert(
"CMAKE_INSTALL_LIBDIR".into(),

View file

@ -9,11 +9,7 @@ use std::{
path::Path,
};
pub fn get_build_wivrn_jobs(
profile: &Profile,
clean_build: bool,
debug_build: bool,
) -> VecDeque<WorkerJob> {
pub fn get_build_wivrn_jobs(profile: &Profile, clean_build: bool) -> VecDeque<WorkerJob> {
let mut jobs = VecDeque::<WorkerJob>::new();
let git = Git {

View file

@ -115,7 +115,7 @@ pub enum Msg {
OnBuildLog(Vec<String>),
OnBuildExit(i32),
ClockTicking,
BuildProfile(bool, bool),
BuildProfile(bool),
CancelBuild,
EnableDebugViewChanged(bool),
DoStartStopXRService,
@ -425,7 +425,7 @@ impl SimpleComponent for App {
}
}
},
Msg::BuildProfile(clean_build, debug_build) => {
Msg::BuildProfile(clean_build) => {
let profile = self.get_selected_profile();
let mut missing_deps = vec![];
let mut jobs = VecDeque::<WorkerJob>::new();
@ -452,20 +452,12 @@ impl SimpleComponent for App {
jobs.push_back(get_build_mercury_job(&profile));
}
jobs.extend(match profile.xrservice_type {
XRServiceType::Monado => {
get_build_monado_jobs(&profile, clean_build, debug_build)
}
XRServiceType::Wivrn => {
get_build_wivrn_jobs(&profile, clean_build, debug_build)
}
XRServiceType::Monado => get_build_monado_jobs(&profile, clean_build),
XRServiceType::Wivrn => get_build_wivrn_jobs(&profile, clean_build),
});
// no listed deps for opencomp
}
jobs.extend(get_build_opencomposite_jobs(
&profile,
clean_build,
debug_build,
));
jobs.extend(get_build_opencomposite_jobs(&profile, clean_build));
if !missing_deps.is_empty() {
missing_deps.sort_unstable();
missing_deps.dedup(); // dedup only works if sorted, hence the above
@ -772,7 +764,6 @@ impl SimpleComponent for App {
root_win: root.clone().into(),
})
.forward(sender.input_sender(), |message| match message {
MainViewOutMsg::EnableDebugViewChanged(val) => Msg::EnableDebugViewChanged(val),
MainViewOutMsg::DoStartStopXRService => Msg::DoStartStopXRService,
MainViewOutMsg::StartWithDebug => Msg::StartWithDebug,
MainViewOutMsg::RestartXRService => Msg::RestartXRService,
@ -823,28 +814,14 @@ impl SimpleComponent for App {
actions,
BuildProfileAction,
clone!(@strong sender => move |_| {
sender.input_sender().emit(Msg::BuildProfile(false, false));
sender.input_sender().emit(Msg::BuildProfile(false));
})
);
stateless_action!(
actions,
BuildProfileCleanAction,
clone!(@strong sender => move |_| {
sender.input_sender().emit(Msg::BuildProfile(true, false));
})
);
stateless_action!(
actions,
BuildProfileDebugAction,
clone!(@strong sender => move |_| {
sender.input_sender().emit(Msg::BuildProfile(false, true));
})
);
stateless_action!(
actions,
BuildProfileCleanDebugAction,
clone!(@strong sender => move |_| {
sender.input_sender().emit(Msg::BuildProfile(true, true));
sender.input_sender().emit(Msg::BuildProfile(true));
})
);
stateless_action!(
@ -922,8 +899,6 @@ new_action_group!(pub AppActionGroup, "win");
new_stateless_action!(pub AboutAction, AppActionGroup, "about");
new_stateless_action!(pub BuildProfileAction, AppActionGroup, "buildprofile");
new_stateless_action!(pub BuildProfileCleanAction, AppActionGroup, "buildprofileclean");
new_stateless_action!(pub BuildProfileDebugAction, AppActionGroup, "buildprofiledebug");
new_stateless_action!(pub BuildProfileCleanDebugAction, AppActionGroup, "buildprofilecleandebug");
new_stateless_action!(pub ConfigFbtAction, AppActionGroup, "configfbt");
new_stateless_action!(pub QuitAction, AppActionGroup, "quit");
new_stateful_action!(pub DebugViewToggleAction, AppActionGroup, "debugviewtoggle", (), bool);

View file

@ -14,8 +14,8 @@ use crate::gpu_profile::{
use crate::profile::{LighthouseDriver, Profile, XRServiceType};
use crate::steamvr_utils::chaperone_info_exists;
use crate::ui::app::{
AboutAction, BuildProfileAction, BuildProfileCleanAction, BuildProfileCleanDebugAction,
BuildProfileDebugAction, ConfigFbtAction, DebugViewToggleAction,
AboutAction, BuildProfileAction, BuildProfileCleanAction, ConfigFbtAction,
DebugViewToggleAction,
};
use crate::ui::profile_editor::ProfileEditorInit;
use crate::ui::steamvr_calibration_box::SteamVrCalibrationBoxMsg;
@ -76,7 +76,6 @@ pub enum MainViewMsg {
#[derive(Debug)]
pub enum MainViewOutMsg {
EnableDebugViewChanged(bool),
DoStartStopXRService,
StartWithDebug,
RestartXRService,
@ -123,10 +122,6 @@ impl SimpleComponent for MainView {
"C_lean Build Profile" => BuildProfileCleanAction,
"Configure Full Body _Tracking" => ConfigFbtAction,
},
section! {
"Build Profile with Debug Symbols" => BuildProfileDebugAction,
"Clean Build Profile with Debug Symbols" => BuildProfileCleanDebugAction,
},
section! {
"_About" => AboutAction,
}