Skip to content

Commit

Permalink
Disable libxcfe under windows as I am unable to build it
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty/Benediction committed Oct 8, 2023
1 parent 02f5c8a commit 4340c7c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
33 changes: 16 additions & 17 deletions cpclib-asm/src/assembler/save_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cpclib_disc::edsk::{ExtendedDsk, Head};
use cpclib_tokens::SaveType;
use cpclib_disc::disc::Disc;

#[cfg(not(target_arch = "wasm32"))]
#[cfg(all(not(target_os="windows"), not(target_arch = "wasm32")))]
use cpclib_disc::hfe::Hfe;

use super::report::SavedFile;
Expand Down Expand Up @@ -115,22 +115,21 @@ impl SaveCommand {
match object {
either::Right(amsdos_file) => {
if let Some(disc_filename) = &self.disc_filename {
let mut disc = if std::path::Path::new(disc_filename.as_str()).exists() {
#[cfg(not(target_arch = "wasm32"))]
{Hfe::open(disc_filename)
.map_err(|e| AssemblerError::AssemblingError { msg: format!("Error while loading {e}") })
?}
#[cfg(target_arch = "wasm32")]
{ExtendedDsk::open(disc_filename)
.map_err(|e| AssemblerError::AssemblingError { msg: format!("Error while loading {e}") })
?}
}
else {
#[cfg(not(target_arch = "wasm32"))]
{Hfe::default()}
#[cfg(target_arch = "wasm32")]
{ExtendedDsk::default()}


#[cfg(all(not(target_os="windows"), not(target_arch = "wasm32")))]
let mut disc : Hfe = if std::path::Path::new(disc_filename.as_str()).exists() {
Hfe::open(disc_filename)
.map_err(|e| AssemblerError::AssemblingError { msg: format!("Error while loading {e}") })?
} else {
Hfe::default()
};
#[cfg(any(target_os="windows",target_arch = "wasm32"))]
let mut disc : ExtendedDsk = if std::path::Path::new(disc_filename.as_str()).exists() {
ExtendedDsk::open(disc_filename)
.map_err(|e| AssemblerError::AssemblingError { msg: format!("Error while loading {e}") })
?
} else {
ExtendedDsk::default()
};

let head = Head::A;
Expand Down
2 changes: 1 addition & 1 deletion cpclib-disc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tempfile.workspace = true
log = {workspace = true, optional = true }
simplelog = { workspace = true, optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
[target.'cfg(all(not(target_os = "windows"), not(target_arch = "wasm32")))'.dependencies]
hxcfe.workspace = true

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion cpclib-disc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub mod cfg;
pub mod edsk;
pub mod disc;

#[cfg(not(target_arch = "wasm32"))]
#[cfg(all(not(target_os = "windows"), not(target_arch = "wasm32")))]
/// HFE File format
pub mod hfe;

Expand Down
2 changes: 2 additions & 0 deletions cpclib/tests/disccfgparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use cpclib::disc::disc::Disc;
mod tests {
use std::str::FromStr;

#[cfg(all(not(target_os="windows"), not(target_arch = "wasm32")))]
use cpclib_disc::hfe::Hfe;

const DOUBLE_SIDED: &str = "NbTrack = 80
Expand Down Expand Up @@ -327,6 +328,7 @@ sectorIDHead = 0,0,0,0,0,0,0,0,0,0
}


#[cfg(all(not(target_os="windows"), not(target_arch = "wasm32")))]
#[test]
fn arkos_hfe() {
let cfg =
Expand Down

0 comments on commit 4340c7c

Please sign in to comment.