Pārlūkot izejas kodu

Work around a bug in cargo

Signed-off-by: Mattias Andrée <maandree@kth.se>
Mattias Andrée 9 gadi atpakaļ
vecāks
revīzija
54ed5f6756
1 mainītis faili ar 10 papildinājumiem un 2 dzēšanām
  1. 10 2
      Makefile

+ 10 - 2
Makefile

@@ -4,13 +4,21 @@ BUILD = target/release/exa
 
 $(BUILD):
 	@which rustc > /dev/null || { echo "exa requires Rust to compile. For installation instructions, please visit http://rust-lang.org/"; exit 1; }
-	cargo build --release
+	if test -n "$$(echo "$$CC" | cut -d \  -f 1)"; then \
+	    env CC="$$(echo "$$CC" | cut -d \  -f 1)" cargo build --release; \
+	else\
+	    env -u CC cargo build --release; \
+	fi
 
 build: $(BUILD)
 
 build-no-git:
 	@which rustc > /dev/null || { echo "exa requires Rust to compile. For installation instructions, please visit http://rust-lang.org/"; exit 1; }
-	cargo build --release --no-default-features
+	if test -n "$$(echo "$$CC" | cut -d \  -f 1)"; then \
+	    env CC="$$(echo "$$CC" | cut -d \  -f 1)" cargo build --release --no-default-features; \
+	else\
+	    env -u CC cargo build --release --no-default-features; \
+	fi
 
 INSTALL = $(PREFIX)/bin/exa