2021-09-10 19:34:09 -05:00
|
|
|
# Test the behavior of #[link(.., kind = "raw-dylib")] and #[link_ordinal] on windows-msvc
|
|
|
|
|
2021-11-01 17:49:58 -05:00
|
|
|
# only-windows
|
2021-09-10 19:34:09 -05:00
|
|
|
|
2022-08-22 19:00:00 -05:00
|
|
|
include ../../run-make-fulldeps/tools.mk
|
2021-09-10 19:34:09 -05:00
|
|
|
|
|
|
|
all:
|
2022-07-01 15:01:41 -05:00
|
|
|
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
|
|
|
|
$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
|
2021-09-10 19:34:09 -05:00
|
|
|
$(call COMPILE_OBJ,"$(TMPDIR)"/exporter.obj,exporter.c)
|
2021-11-01 17:49:58 -05:00
|
|
|
ifdef IS_MSVC
|
2022-07-01 15:01:41 -05:00
|
|
|
$(CC) "$(TMPDIR)"/exporter.obj exporter.def -link -dll -out:"$(TMPDIR)"/exporter.dll -noimplib
|
2021-11-01 17:49:58 -05:00
|
|
|
else
|
|
|
|
$(CC) "$(TMPDIR)"/exporter.obj exporter.def -shared -o "$(TMPDIR)"/exporter.dll
|
|
|
|
endif
|
2021-09-10 19:34:09 -05:00
|
|
|
"$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
|
|
|
|
|
|
|
|
ifdef RUSTC_BLESS_TEST
|
|
|
|
cp "$(TMPDIR)"/output.txt output.txt
|
|
|
|
else
|
|
|
|
$(DIFF) output.txt "$(TMPDIR)"/output.txt
|
|
|
|
endif
|