dmd on windows will not be supported

This commit is contained in:
Thomas Nagy 2011-10-19 04:11:25 +02:00
parent a65b19cb36
commit c8448e9c30
2 changed files with 13 additions and 65 deletions

View File

@ -7,6 +7,7 @@ import os, sys
from waflib import Utils, Task, Errors
from waflib.TaskGen import taskgen_method, feature, after_method, before_method, extension
from waflib.Configure import conf
from waflib.Tools.ccroot import link_task
from waflib.Tools import d_scan, d_config
from waflib.Tools.ccroot import link_task, stlink_task
@ -53,26 +54,7 @@ def d_hook(self, node):
header_node = node.change_ext(self.env['DHEADER_ext'])
task.outputs.append(header_node)
else:
if self.env.D2:
try:
task = self.link_task
except AttributeError:
name = ''
for x in self.features:
x = 'd2' + x[1:]
if x in Task.classes and issubclass(Task.classes[x], link_task):
name = x
break
task = self.link_task = self.create_task(name, node)
task.add_target(self.target)
if 'apply_link' in self.meths:
self.meths.remove('apply_link')
else:
task.inputs.append(node)
else:
task = self.create_compiled_task('d', node)
task = self.create_compiled_task('d', node)
return task
@taskgen_method

View File

@ -4,12 +4,9 @@
# Thomas Nagy, 2008-2010 (ita)
import sys
from waflib import Utils
from waflib.Tools import ar, d, ccroot
from waflib.Tools import ar, d
from waflib.Configure import conf
ccroot.USELIB_VARS['dstlib'].add('D2LINKFLAGS')
@conf
def find_dmd(conf):
"""
@ -63,53 +60,22 @@ def common_flags_dmd(conf):
v.DFLAGS_d_with_header = ['-H', '-Hf']
v['D_HDR_F'] = '%s'
class d2program(ccroot.link_task):
run_str = '${D} ${LINKFLAGS} ${D2LINKFLAGS} ${DINC_ST:INCPATHS} ${SRC} ${DLNK_TGT_F:TGT} ${DSTLIB_MARKER} ${DSTLIBPATH_ST:STLIBPATH} ${DSTLIB_ST:STLIB} ${DSHLIB_MARKER} ${DLIBPATH_ST:LIBPATH} ${DSHLIB_ST:LIB}'
inst_to = '${BINDIR}'
chmod = Utils.O755
class d2shlib(d2program):
"Link object files into a d shared library"
inst_to = '${LIBDIR}'
class d2stlib(d2program):
"Link object files into a d static library"
inst_to = None
def configure(conf):
"""
Configuration for dmd/ldc
"""
conf.find_dmd()
out = conf.cmd_and_log([conf.env.D, '--help'])
if out.find("D Compiler v2.") > -1:
conf.env.D2 = 1
conf.env.DLNK_TGT_F = '-of%s'
if Utils.destos_to_binfmt(conf.env.DEST_OS) == 'pe':
conf.env['d2program_PATTERN'] = '%s.exe'
conf.env['d2shlib_PATTERN'] = 'lib%s.dll'
conf.env['d2stlib_PATTERN'] = 'lib%s.a'
else:
conf.env['d2program_PATTERN'] = '%s'
conf.env['d2shlib_PATTERN'] = 'lib%s.so'
conf.env['d2stlib_PATTERN'] = 'lib%s.a'
if sys.platform == 'win32':
out = conf.cmd_and_log([conf.env.D, '--help'])
if out.find("D Compiler v2.") > -1:
conf.fatal('dmd2 on Windows is not supported, use gdc or ldc instead')
conf.env.D2LINKFLAGS_dstlib = ['-lib']
#conf.env.DSTLIBPATH_ST = '-L%s'
conf.env.DSTLIB_ST = '-l'
conf.env.DINC_ST = '-I%s'
conf.load('ar')
conf.load('d')
conf.common_flags_dmd()
conf.d_platform_flags()
v = conf.env
v['DSHLIB_MARKER'] = v['DSTLIB_MARKER'] = ''
v['DSTLIB_ST'] = v['DSHLIB_ST'] = '-L-l%s'
v['DSTLIBPATH_ST'] = v['DLIBPATH_ST'] = '-L-L%s'
else:
conf.load('ar')
conf.load('d')
conf.common_flags_dmd()
conf.d_platform_flags()
if str(conf.env.D).find('ldc') > -1:
conf.common_flags_ldc()
if str(conf.env.D).find('ldc') > -1:
conf.common_flags_ldc()