Skip to content

Commit

Permalink
no need for git
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Aug 31, 2023
1 parent 6d0d2d4 commit 14faca6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions soloud-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ fn main() {
println!("cargo:rerun-if-changed=build/source.rs");

let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let target_triple = env::var("TARGET").unwrap();

source::build(&manifest_dir, &target_triple, &out_dir);
source::build(&target_triple, &out_dir);
link::link(&out_dir);
}
12 changes: 3 additions & 9 deletions soloud-sys/build/source.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{env, path::Path, process::Command};
use std::{env, path::Path};

pub fn build(manifest_dir: &Path, target_triple: &str, out_dir: &Path) {
pub fn build(target_triple: &str, out_dir: &Path) {
println!("cargo:rerun-if-env-changed=CC");
println!("cargo:rerun-if-env-changed=CXX");
println!("cargo:rerun-if-env-changed=CFLAGS");
Expand All @@ -10,12 +10,6 @@ pub fn build(manifest_dir: &Path, target_triple: &str, out_dir: &Path) {
println!("cargo:rerun-if-changed=sys/soloud_derives.h");
println!("cargo:rerun-if-changed=sys/soloud_derives.cpp");

Command::new("git")
.args(&["submodule", "update", "--init"])
.current_dir(&manifest_dir)
.status()
.expect("Git is needed to retrieve the soloud source files!");

if target_triple.contains("android") {
crate::android::build(out_dir, target_triple);
} else {
Expand Down Expand Up @@ -64,7 +58,7 @@ pub fn build(manifest_dir: &Path, target_triple: &str, out_dir: &Path) {
}

let _dst = dst
.profile("Release")
.profile("Debug")
.define("CMAKE_EXPORT_COMPILE_COMMANDS", "ON")
.build();
}
Expand Down

0 comments on commit 14faca6

Please sign in to comment.