Skip to content

Commit

Permalink
do not init submodule if not enabling bundle feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Apr 29, 2024
1 parent 146cff6 commit 6e1b82e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdl2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ macro_rules! add_msvc_includes_to_bindings {
};
}

#[cfg(feature = "bundled")]
fn init_submodule(sdl_path: &Path) {
if !sdl_path.join("CMakeLists.txt").exists() {
Command::new("git")
Expand Down Expand Up @@ -493,11 +494,11 @@ fn main() {
let target_os = get_os_from_triple(target.as_str()).unwrap();

let sdl2_source_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()).join("SDL");
init_submodule(sdl2_source_path.as_path());

let sdl2_compiled_path: PathBuf;
#[cfg(feature = "bundled")]
{
init_submodule(sdl2_source_path.as_path());
sdl2_compiled_path = compile_sdl2(sdl2_source_path.as_path(), target_os);

println!(
Expand Down

0 comments on commit 6e1b82e

Please sign in to comment.