Skip to content

Commit a860907

Browse files
authored
Merge pull request #126 from kinetiknz/nightly_fix
Fix failing build_ffi test under current nightly after rust-lang/rust#43067 landed.
2 parents 0f39f07 + 6ec877f commit a860907

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

mp4parse_capi/examples/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,33 @@ check: all
99
HEADER := ../include/mp4parse.h
1010
CXXFLAGS = -g -Wall -std=c++11 -I$(dir $(HEADER))
1111

12+
# Printing linker libraries by default was removed in rustc 1.23, so we need to
13+
# request them explicitly.
14+
RUSTC_MINOR_VERSION := $(shell rustc --version | cut -f2 -d.)
15+
RUSTC_MINOR_LT_23 := $(shell [ $(RUSTC_MINOR_VERSION) -lt 23 ] && echo true)
16+
17+
ifeq ($(RUSTC_MINOR_LT_23), true)
18+
PRINT_NATIVE_STATIC_LIBS :=
19+
else
20+
PRINT_NATIVE_STATIC_LIBS := --print native-static-libs
21+
endif
22+
1223
CRATE_DIR := ../../target/debug/deps
1324

1425
libmp4parse.a libmp4parse.a.out : ../src/lib.rs
1526
rustc -g --crate-type staticlib --crate-name mp4parse \
1627
--emit dep-info,link=$@ \
28+
$(PRINT_NATIVE_STATIC_LIBS) \
1729
-L $(CRATE_DIR) $< \
1830
2> libmp4parse.a.out || cat libmp4parse.a.out >&2
1931

2032
-include mp4parse.d
2133

34+
ifeq ($(RUSTC_MINOR_LT_23), true)
2235
test: RUST_LIBS = $(shell awk '/^note: library: / {print "-l"$$3}' libmp4parse.a.out)
36+
else
37+
test: RUST_LIBS = $(shell sed -n 's/^note: native-static-libs: //p' libmp4parse.a.out)
38+
endif
2339
test: test.cc libmp4parse.a $(HEADER)
2440
$(CXX) $(CXXFLAGS) -c $(filter %.cc,$^)
2541
$(CXX) $(CXXFLAGS) -o $@ *.o libmp4parse.a $(RUST_LIBS)

mp4parse_capi/tests/build_ffi_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ fn build_ffi_test() {
66
let output = Command::new("make")
77
.arg("-C")
88
.arg("examples")
9+
.arg("clean")
910
.arg("check")
1011
.output()
1112
.expect("failed to execute process");

0 commit comments

Comments
 (0)