posix.mak - module specific -dip25/1000 for someModule.test and unittest rules #6195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@wilzbach
Discussion about this topic is also in
#6041
#6181
aa represents the current state of "phobos -dip1000 compilability".
I preferred associative array aa entries in the "modulename-notation" (e.g. aa[std.array]) instead of OS-dependant "pathname-notation" (didn't recall whether windows can cope with forward-slashes).$(aa[$ (subst /,.,$(basename $<))])
But this only defers the issue to the call-site (I use Linux, i.e. /):
Used currently in 2 rules, e.g.
$(DMD) -od$ $T $(DFLAGS) $ (aa[$(subst /,.,$(basename $<))]) -main $ (UDFLAGS) $(LIB) -defaultlib= -debuglib= $ (LINKDL) -cov -run $< ;
%.test : %.d $(LIB)
T=
mktemp -d /tmp/.dmd-run-test.XXXXXX&&(
RET=$$? ; rm -rf $$T ; exit $$RET
)
Positioning$(aa[$ (subst /,.,$(basename $<))]) after $ (DFLAGS) resulting in e.g. -dip25 -dip1000 always worked for me, the compiler picked up the last one.