summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool/link.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Tool/link.py')
-rw-r--r--src/engine/SCons/Tool/link.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py
index 866df08..4522ba1 100644
--- a/src/engine/SCons/Tool/link.py
+++ b/src/engine/SCons/Tool/link.py
@@ -36,18 +36,27 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import SCons.Defaults
import SCons.Tool
import SCons.Util
-import SCons.Errors
+import SCons.Warnings
from SCons.Tool.FortranCommon import isfortran
cplusplus = __import__('c++', globals(), locals(), [])
+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:
- raise SCons.Errors.InternalError(
- "Sorry, scons cannot yet link c++ and fortran code together.")
+ global issued_mixed_link_warning
+ if not issued_mixed_link_warning:
+ msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \
+ "This may generate a buggy executable if the %s\n\t" + \
+ "compiler does not know how to deal with Fortran runtimes."
+ SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,
+ msg % repr(env.subst('$CXX')))
+ issued_mixed_link_warning = True
+ return '$CXX'
elif has_fortran:
return '$FORTRAN'
elif has_cplusplus: