Skip to content

Commit 3c4e7f0

Browse files
committed
Add configure script for Windows
1 parent af2c72e commit 3c4e7f0

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: gifski
22
Type: Package
33
Title: Highest Quality GIF Encoder
4-
Version: 1.6.7
4+
Version: 1.7.0
55
Authors@R: c(
66
person("Jeroen", "Ooms", ,"jeroen@berkeley.edu", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0002-4035-0289")),

configure.win

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
# mimics: source ~/.cargo/env
3+
export PATH="$USERPROFILE/.cargo/bin:$PATH"
4+
5+
# Write 'cargo' to Makevars
6+
VERSION=$(cargo --version)
7+
if [ $? -eq 0 ]; then
8+
echo "Using `which cargo`"
9+
echo "$VERSION"
10+
else
11+
echo "Cargo not found. Falling back to static libraries"
12+
cp -f src/Makevars.win.static src/Makevars.win
13+
fi
14+
exit 0

src/Makevars.win

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ LIBDIR = myrustlib/target/$(TARGET)/release
33
STATLIB = $(LIBDIR)/libmyrustlib.a
44
PKG_LIBS = -L$(LIBDIR) -lmyrustlib -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt
55

6-
# These can also be set in ~/.cargo/config
7-
#export CARGO_TARGET_I686_PC_WINDOWS_GNU_LINKER=C:\\rtools40\\mingw$(WIN)\\bin\\gcc
8-
#export CC=$(CC)
9-
#export AR=$(AR)
10-
11-
# This bypasses the exception stuff
12-
#export CARGO_TARGET_I686_PC_WINDOWS_GNU_RUSTFLAGS=-C panic=abort
136
ifeq ($(R_COMPILED_BY),gcc 8.3.0)
147
GCCPATH=$(subst C:\,/c/,$(RTOOLS40_HOME))/mingw$(WIN)/bin
158
else
@@ -23,7 +16,7 @@ all: clean rustup
2316
$(SHLIB): $(STATLIB)
2417

2518
$(STATLIB):
26-
ifeq ($(WIN),64) #hack for mxe-rtools42
19+
ifeq ($(WIN),64) #hack for missing libgcc_eh in mxe-rtools42
2720
mkdir -p myrustlib/target/release/deps; echo '!<arch>' > myrustlib/target/release/deps/libgcc_eh.a
2821
endif
2922
PATH="$(GCCPATH):$(USERPROFILE)\.cargo:$(PATH)" cargo build --target=$(TARGET) --release --manifest-path=myrustlib/Cargo.toml

0 commit comments

Comments
 (0)