Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
- Some cleanups in EnvironmentTests.py
- Small performance tweak in arg2nodes (SubstitutionEnvironment): fast-path
strings which are fully expanded (i.e., no $). Add unit tests.
- Workaround issue where D compiler ldc2 can't find linker.
- Reference manual improvements:
* Additional clarification for SideEffect()
* Split out a new section on Emitters with additional prose and
Expand Down
2 changes: 2 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ FIXES
could start another worker before it was recorded, so more worker threads
than -j could run.

- Workaround issue where D compiler ldc2 can't find linker.

IMPROVEMENTS
------------

Expand Down
15 changes: 12 additions & 3 deletions SCons/Tool/DCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
2012-09-06
"""

from pathlib import Path
import os.path
from pathlib import Path

import SCons.Util


def isD(env, source) -> bool:
Expand All @@ -47,13 +49,20 @@ def isD(env, source) -> bool:
def addDPATHToEnv(env, executable) -> None:
dPath = env.WhereIs(executable)
if dPath:
phobosDir = dPath[:dPath.rindex(executable)] + '/../src/phobos'
# *executable* may name arguments as well as a program
# (``WhereIs`` supports "program --with-args"), so derive the
# phobos directory from the directory the program was found in
# rather than from the value passed in.
phobosDir = os.path.join(os.path.dirname(dPath), '..', 'src', 'phobos')
if os.path.isdir(phobosDir):
env.Append(DPATH=[phobosDir])


def allAtOnceEmitter(target, source, env):
if env['DC'] in ('ldc2', 'dmd'):
# ``$DC`` may carry arguments (e.g. "ldc2 --linker=bfd"), so only the
# program name is relevant when deciding on the implicit object file.
dc = SCons.Util.CLVar(env.subst('$DC'))
if dc and dc[0] in ('ldc2', 'dmd'):
env.SideEffect(str(target[0]) + '.o', target[0])
env.Clean(target[0], str(target[0]) + '.o')
return target, source
Expand Down
2 changes: 1 addition & 1 deletion SCons/Tool/ldc.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def generate(env) -> None:
env['DI_FILE_DIR_SUFFFIX'] = ''

env['DLINK'] = '$DC'
env['DLINKFLAGS'] = SCons.Util.CLVar('')
env['DLINKFLAGS'] = SCons.Util.CLVar('--linker=bfd')
env['DLINKCOM'] = '$DLINK -of=$TARGET $DLINKFLAGS $__DRPATH $SOURCES $_DLIBDIRFLAGS $_DLIBFLAGS'

env['SHDLINK'] = '$DC'
Expand Down
Loading