diff options
author | Russel Winder <russel@winder.org.uk> | 2014-04-16 09:46:39 (GMT) |
---|---|---|
committer | Russel Winder <russel@winder.org.uk> | 2014-04-16 09:46:39 (GMT) |
commit | da72e009ae9e2f450a601d52f2530338efa6a377 (patch) | |
tree | df6efa619e83c0cfc7bd932ae3c9c786cf812246 /src/engine/SCons/Tool/link.py | |
parent | d4f8c6e320484c106446918c37affdddacd5c7a3 (diff) | |
download | SCons-da72e009ae9e2f450a601d52f2530338efa6a377.zip SCons-da72e009ae9e2f450a601d52f2530338efa6a377.tar.gz SCons-da72e009ae9e2f450a601d52f2530338efa6a377.tar.bz2 |
The changes to the D support evolved over the last many months packaged as a single changeset.
Diffstat (limited to 'src/engine/SCons/Tool/link.py')
-rw-r--r-- | src/engine/SCons/Tool/link.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py index 3f20fe0..baa7407 100644 --- a/src/engine/SCons/Tool/link.py +++ b/src/engine/SCons/Tool/link.py @@ -42,6 +42,8 @@ import SCons.Warnings from SCons.Tool.FortranCommon import isfortran +from SCons.Tool.DCommon import isD + cplusplus = __import__('c++', globals(), locals(), []) issued_mixed_link_warning = False @@ -49,7 +51,8 @@ issued_mixed_link_warning = False def smart_link(source, target, env, for_signature): has_cplusplus = cplusplus.iscplusplus(source) has_fortran = isfortran(env, source) - if has_cplusplus and has_fortran: + has_d = isD(env, source) + if has_cplusplus and has_fortran and not has_d: global issued_mixed_link_warning if not issued_mixed_link_warning: msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \ @@ -59,6 +62,10 @@ def smart_link(source, target, env, for_signature): msg % env.subst('$CXX')) issued_mixed_link_warning = True return '$CXX' + elif has_d: + env['LINKCOM'] = env['DLINKCOM'] + env['SHLINKCOM'] = env['SHDLINKCOM'] + return '$DC' elif has_fortran: return '$FORTRAN' elif has_cplusplus: @@ -138,7 +145,7 @@ def shlib_emitter_names(target, source, env): print "shlib_emitter_names: side effect: ", name # add version_name to list of names to be a Side effect version_names.append(version_name) - + except KeyError: version = None return version_names @@ -178,8 +185,8 @@ def generate(env): # don't set up the emitter, cause AppendUnique will generate a list # starting with None :-( env.Append(LDMODULEEMITTER='$SHLIBEMITTER') - env['LDMODULEPREFIX'] = '$SHLIBPREFIX' - env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' + env['LDMODULEPREFIX'] = '$SHLIBPREFIX' + env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' env['LDMODULEFLAGS'] = '$SHLINKFLAGS' env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' |