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
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 build_dir = format!("{}/build", profile.features.basalt.path.as_ref().unwrap());
let mut cmake_vars: HashMap<String, String> = HashMap::new(); 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_PREFIX".into(), profile.prefix.clone());
cmake_vars.insert("BUILD_TESTS".into(), "OFF".into()); cmake_vars.insert("BUILD_TESTS".into(), "OFF".into());
cmake_vars.insert("BASALT_INSTANTIATIONS_DOUBLE".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() profile.features.libsurvive.path.as_ref().unwrap()
); );
let mut cmake_vars: HashMap<String, String> = HashMap::new(); 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("ENABLE_api_example".into(), "OFF".into());
cmake_vars.insert("USE_HIDAPI".into(), "ON".into()); cmake_vars.insert("USE_HIDAPI".into(), "ON".into());
cmake_vars.insert("CMAKE_SKIP_INSTALL_RPATH".into(), "YES".into()); cmake_vars.insert("CMAKE_SKIP_INSTALL_RPATH".into(), "YES".into());

View file

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

View file

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

View file

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

View file

@ -115,7 +115,7 @@ pub enum Msg {
OnBuildLog(Vec<String>), OnBuildLog(Vec<String>),
OnBuildExit(i32), OnBuildExit(i32),
ClockTicking, ClockTicking,
BuildProfile(bool, bool), BuildProfile(bool),
CancelBuild, CancelBuild,
EnableDebugViewChanged(bool), EnableDebugViewChanged(bool),
DoStartStopXRService, 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 profile = self.get_selected_profile();
let mut missing_deps = vec![]; let mut missing_deps = vec![];
let mut jobs = VecDeque::<WorkerJob>::new(); let mut jobs = VecDeque::<WorkerJob>::new();
@ -452,20 +452,12 @@ impl SimpleComponent for App {
jobs.push_back(get_build_mercury_job(&profile)); jobs.push_back(get_build_mercury_job(&profile));
} }
jobs.extend(match profile.xrservice_type { jobs.extend(match profile.xrservice_type {
XRServiceType::Monado => { XRServiceType::Monado => get_build_monado_jobs(&profile, clean_build),
get_build_monado_jobs(&profile, clean_build, debug_build) XRServiceType::Wivrn => get_build_wivrn_jobs(&profile, clean_build),
}
XRServiceType::Wivrn => {
get_build_wivrn_jobs(&profile, clean_build, debug_build)
}
}); });
// no listed deps for opencomp // no listed deps for opencomp
} }
jobs.extend(get_build_opencomposite_jobs( jobs.extend(get_build_opencomposite_jobs(&profile, clean_build));
&profile,
clean_build,
debug_build,
));
if !missing_deps.is_empty() { if !missing_deps.is_empty() {
missing_deps.sort_unstable(); missing_deps.sort_unstable();
missing_deps.dedup(); // dedup only works if sorted, hence the above missing_deps.dedup(); // dedup only works if sorted, hence the above
@ -772,7 +764,6 @@ impl SimpleComponent for App {
root_win: root.clone().into(), root_win: root.clone().into(),
}) })
.forward(sender.input_sender(), |message| match message { .forward(sender.input_sender(), |message| match message {
MainViewOutMsg::EnableDebugViewChanged(val) => Msg::EnableDebugViewChanged(val),
MainViewOutMsg::DoStartStopXRService => Msg::DoStartStopXRService, MainViewOutMsg::DoStartStopXRService => Msg::DoStartStopXRService,
MainViewOutMsg::StartWithDebug => Msg::StartWithDebug, MainViewOutMsg::StartWithDebug => Msg::StartWithDebug,
MainViewOutMsg::RestartXRService => Msg::RestartXRService, MainViewOutMsg::RestartXRService => Msg::RestartXRService,
@ -823,28 +814,14 @@ impl SimpleComponent for App {
actions, actions,
BuildProfileAction, BuildProfileAction,
clone!(@strong sender => move |_| { clone!(@strong sender => move |_| {
sender.input_sender().emit(Msg::BuildProfile(false, false)); sender.input_sender().emit(Msg::BuildProfile(false));
}) })
); );
stateless_action!( stateless_action!(
actions, actions,
BuildProfileCleanAction, BuildProfileCleanAction,
clone!(@strong sender => move |_| { clone!(@strong sender => move |_| {
sender.input_sender().emit(Msg::BuildProfile(true, false)); sender.input_sender().emit(Msg::BuildProfile(true));
})
);
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));
}) })
); );
stateless_action!( stateless_action!(
@ -922,8 +899,6 @@ new_action_group!(pub AppActionGroup, "win");
new_stateless_action!(pub AboutAction, AppActionGroup, "about"); new_stateless_action!(pub AboutAction, AppActionGroup, "about");
new_stateless_action!(pub BuildProfileAction, AppActionGroup, "buildprofile"); new_stateless_action!(pub BuildProfileAction, AppActionGroup, "buildprofile");
new_stateless_action!(pub BuildProfileCleanAction, AppActionGroup, "buildprofileclean"); 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 ConfigFbtAction, AppActionGroup, "configfbt");
new_stateless_action!(pub QuitAction, AppActionGroup, "quit"); new_stateless_action!(pub QuitAction, AppActionGroup, "quit");
new_stateful_action!(pub DebugViewToggleAction, AppActionGroup, "debugviewtoggle", (), bool); 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::profile::{LighthouseDriver, Profile, XRServiceType};
use crate::steamvr_utils::chaperone_info_exists; use crate::steamvr_utils::chaperone_info_exists;
use crate::ui::app::{ use crate::ui::app::{
AboutAction, BuildProfileAction, BuildProfileCleanAction, BuildProfileCleanDebugAction, AboutAction, BuildProfileAction, BuildProfileCleanAction, ConfigFbtAction,
BuildProfileDebugAction, ConfigFbtAction, DebugViewToggleAction, DebugViewToggleAction,
}; };
use crate::ui::profile_editor::ProfileEditorInit; use crate::ui::profile_editor::ProfileEditorInit;
use crate::ui::steamvr_calibration_box::SteamVrCalibrationBoxMsg; use crate::ui::steamvr_calibration_box::SteamVrCalibrationBoxMsg;
@ -76,7 +76,6 @@ pub enum MainViewMsg {
#[derive(Debug)] #[derive(Debug)]
pub enum MainViewOutMsg { pub enum MainViewOutMsg {
EnableDebugViewChanged(bool),
DoStartStopXRService, DoStartStopXRService,
StartWithDebug, StartWithDebug,
RestartXRService, RestartXRService,
@ -123,10 +122,6 @@ impl SimpleComponent for MainView {
"C_lean Build Profile" => BuildProfileCleanAction, "C_lean Build Profile" => BuildProfileCleanAction,
"Configure Full Body _Tracking" => ConfigFbtAction, "Configure Full Body _Tracking" => ConfigFbtAction,
}, },
section! {
"Build Profile with Debug Symbols" => BuildProfileDebugAction,
"Clean Build Profile with Debug Symbols" => BuildProfileCleanDebugAction,
},
section! { section! {
"_About" => AboutAction, "_About" => AboutAction,
} }