aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/dmd.eclass')
-rw-r--r--eclass/dmd.eclass17
1 files changed, 16 insertions, 1 deletions
diff --git a/eclass/dmd.eclass b/eclass/dmd.eclass
index 1e49af7..52e4209 100644
--- a/eclass/dmd.eclass
+++ b/eclass/dmd.eclass
@@ -233,7 +233,22 @@ dmd_src_compile() {
dmd_src_test() {
test_hello_world() {
- "$(dmd_gen_exe_dir)/dmd" -m${MODEL} -fPIC -Iphobos -Idruntime/import -L-Lphobos/generated/linux/release/${MODEL} samples/d/hello.d || die "Failed to build hello.d (${MODEL}-bit)"
+ local phobosDir=phobos/generated/linux/release/"${MODEL}"
+ local commandArgs=(
+ # Copied from below, where dmd.conf is generated
+ -L--export-dynamic
+ -defaultlib=phobos2 # If unspecified, defaults to libphobos2.a
+ -fPIC
+ -L-L"${phobosDir}"
+ -L-rpath="${phobosDir}"
+
+ -conf= # Don't use dmd.conf
+ -m"${MODEL}"
+ -Iphobos
+ -Idruntime/import
+ )
+ "$(dmd_gen_exe_dir)/dmd" "${commandArgs[@]}" samples/d/hello.d \
+ || die "Failed to build hello.d (${MODEL}-bit)"
./hello ${MODEL}-bit || die "Failed to run test sample (${MODEL}-bit)"
rm hello.o hello || die "Could not remove temporary files"
}