Skip to content

Commit bcd303d

Browse files
committed
Use generated DMD binary instead of src/dmd
auto-tester might run the testsuite with a different $(MODEL) than DMD has been compiled with. Hence we manually check which binary exists to infer the host model.
1 parent f27ee71 commit bcd303d

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

test/Makefile

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ endif
8585
include ../src/osmodel.mak
8686

8787
export OS
88+
BUILD=release
8889

8990
ifeq (freebsd,$(OS))
9091
SHELL=/usr/local/bin/bash
@@ -100,31 +101,40 @@ export REQUIRED_ARGS=
100101

101102
ifeq ($(findstring win,$(OS)),win)
102103
export ARGS=-inline -release -g -O
103-
export DMD=../src/dmd.exe
104104
export EXE=.exe
105105
export OBJ=.obj
106106
export DSEP=\\
107107
export SEP=$(subst /,\,/)
108-
109-
DRUNTIME_PATH=..\..\druntime
110-
PHOBOS_PATH=..\..\phobos
111-
export DFLAGS=-I$(DRUNTIME_PATH)\import -I$(PHOBOS_PATH)
112-
export LIB=$(PHOBOS_PATH)
113108
else
114109
export ARGS=-inline -release -g -O -fPIC
115-
export DMD=../src/dmd
116110
export EXE=
117111
export OBJ=.o
118112
export DSEP=/
119113
export SEP=/
114+
endif
120115

116+
# auto-tester might run the testsuite with a different $(MODEL) than DMD
117+
# has been compiled with. Hence we manually check which binary exists.
118+
ifeq (,$(wildcard ../generated/$(OS)/$(BUILD)/64/dmd$(EXE)))
119+
DMD_MODEL=32
120+
else
121+
DMD_MODEL=64
122+
endif
123+
export DMD=../generated/$(OS)/$(BUILD)/$(DMD_MODEL)/dmd$(EXE)
124+
125+
ifeq ($(findstring win,$(OS)),win)
126+
DRUNTIME_PATH=..\..\druntime
127+
PHOBOS_PATH=..\..\phobos
128+
export DFLAGS=-I$(DRUNTIME_PATH)\import -I$(PHOBOS_PATH)
129+
export LIB=$(PHOBOS_PATH)
130+
else
121131
DRUNTIME_PATH=../../druntime
122132
PHOBOS_PATH=../../phobos
123133
# link against shared libraries (defaults to true on supported platforms, can be overridden w/ make SHARED=0)
124134
SHARED=$(if $(findstring $(OS),linux freebsd),1,)
125-
DFLAGS=-I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL)
135+
DFLAGS=-I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL)
126136
ifeq (1,$(SHARED))
127-
DFLAGS+=-defaultlib=libphobos2.so -L-rpath=$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL)
137+
DFLAGS+=-defaultlib=libphobos2.so -L-rpath=$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL)
128138
endif
129139
export DFLAGS
130140
endif

test/foo

643 KB
Binary file not shown.

0 commit comments

Comments
 (0)