Skip to content

Commit

Permalink
Version 0.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencilcaseman committed Oct 14, 2024
1 parent 115cbb7 commit e35142b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 50 deletions.
78 changes: 36 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sccmod"
authors = ["Toby Davis \"Pencilcaseman\""]
version = "0.5.6"
version = "0.5.7"
edition = "2021"
readme = "README.md"
license = "MIT OR Apache-2.0"
Expand All @@ -13,12 +13,12 @@ keywords = ["package-manager", "version-system", "builder"]
categories = ["command-line-utilities"]

[dependencies]
anstyle = "1.0.6"
clap = { version = "4.5.4", features = ["derive", "cargo"] }
anstyle = "1.0.8"
clap = { version = "4.5.20", features = ["derive", "cargo"] }
colored = "2.1.0"
crossterm = "0.28"
crossterm = "0.28.1"
pyo3 = { version = "0.21.2", features = ["auto-initialize"] }
toml = "0.8.12"
toml = "0.8.19"

[lints.clippy]
pedantic = "warn"
Expand Down
24 changes: 22 additions & 2 deletions src/builders/cmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum CMakeBuildType {
pub struct CMake {
pub build_type: CMakeBuildType,
pub jobs: usize,
pub prefix_args: Option<Vec<String>>,
pub configure_flags: Option<Vec<String>>,
pub cmake_root: Option<String>,
}
Expand Down Expand Up @@ -49,7 +50,16 @@ impl CMake {
shell.add_command(&format!("module load {dep}"));
}

let mut cmake_cmd = format!("cmake {source_path:?}");
// let mut cmake_cmd = format!("cmake {source_path:?}");

let mut cmake_cmd = String::new();
if let Some(args) = &self.prefix_args {
for arg in args {
cmake_cmd.push_str(&format!("{arg} "));
}
}

cmake_cmd.push_str(&format!("cmake {source_path:?}"));

if let Some(flags) = &self.configure_flags {
for flag in flags {
Expand Down Expand Up @@ -138,6 +148,16 @@ impl BuilderImpl for CMake {
.extract()
.map_err(|_| "Failed to convert attribute 'jobs' to Rust usize")?;

let prefix_args: Option<Vec<String>> = object
.getattr("prefix_args")
.map_err(|_| {
"Failed to read attribute 'prefix_args' of Builder object"
})?
.extract()
.map_err(|_| {
"Failed to convert attribute 'prefix_args' to Rust Vec<String>"
})?;

let configure_flags: Option<Vec<String>> = object
.getattr("configure_flags")
.map_err(|_| "Failed to read attribute 'configure_flags' of Builder object")?
Expand All @@ -154,7 +174,7 @@ impl BuilderImpl for CMake {
"Failed to convert attribute 'cmake_root' to Rust String"
})?;

Ok(Self { build_type, jobs, configure_flags, cmake_root })
Ok(Self { build_type, jobs, prefix_args, configure_flags, cmake_root })
}

fn build<
Expand Down
8 changes: 7 additions & 1 deletion src/sccmod/builders.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
class CMake:
def __init__(
self, build_type="Release", jobs=8, configure_flags=None, cmake_root=None
self,
build_type="Release",
jobs=8,
prefix_args=None,
configure_flags=None,
cmake_root=None,
):
self.build_type = build_type
self.jobs = jobs
self.prefix_args = prefix_args or []
self.configure_flags = configure_flags or []
self.cmake_root = cmake_root

Expand Down

0 comments on commit e35142b

Please sign in to comment.