fork/rust
git clone https://git.julia.blue/fork/rust
8d69840ab92
1.43.1
1-include ../tools.mk 2 3# aaa is a native static library 4# bbb is a rlib 5# ccc is a dylib 6# ddd is an executable 7 8all: $(call NATIVE_STATICLIB,aaa) 9 $(RUSTC) bbb.rs --crate-type=rlib 10 11 # Check that bbb does NOT contain the definition of `native_func` 12 nm $(TMPDIR)/libbbb.rlib | $(CGREP) -ve "T _*native_func" 13 nm $(TMPDIR)/libbbb.rlib | $(CGREP) -e "U _*native_func" 14 15 # Check that aaa gets linked (either as `-l aaa` or `aaa.lib`) when building ccc. 16 $(RUSTC) ccc.rs -C prefer-dynamic --crate-type=dylib -Z print-link-args | $(CGREP) -e '-l[" ]*aaa|aaa\.lib' 17 18 # Check that aaa does NOT get linked when building ddd. 19 $(RUSTC) ddd.rs -Z print-link-args | $(CGREP) -ve '-l[" ]*aaa|aaa\.lib' 20 21 $(call RUN,ddd)