mirror of https://gitlab.com/ita1024/waf.git
dmd on windows will not be supported
This commit is contained in:
parent
a65b19cb36
commit
c8448e9c30
|
@ -7,6 +7,7 @@ import os, sys
|
||||||
from waflib import Utils, Task, Errors
|
from waflib import Utils, Task, Errors
|
||||||
from waflib.TaskGen import taskgen_method, feature, after_method, before_method, extension
|
from waflib.TaskGen import taskgen_method, feature, after_method, before_method, extension
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
|
from waflib.Tools.ccroot import link_task
|
||||||
from waflib.Tools import d_scan, d_config
|
from waflib.Tools import d_scan, d_config
|
||||||
from waflib.Tools.ccroot import link_task, stlink_task
|
from waflib.Tools.ccroot import link_task, stlink_task
|
||||||
|
|
||||||
|
@ -52,25 +53,6 @@ def d_hook(self, node):
|
||||||
task = self.create_compiled_task('d_with_header', node)
|
task = self.create_compiled_task('d_with_header', node)
|
||||||
header_node = node.change_ext(self.env['DHEADER_ext'])
|
header_node = node.change_ext(self.env['DHEADER_ext'])
|
||||||
task.outputs.append(header_node)
|
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:
|
else:
|
||||||
task = self.create_compiled_task('d', node)
|
task = self.create_compiled_task('d', node)
|
||||||
return task
|
return task
|
||||||
|
|
|
@ -4,12 +4,9 @@
|
||||||
# Thomas Nagy, 2008-2010 (ita)
|
# Thomas Nagy, 2008-2010 (ita)
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from waflib import Utils
|
from waflib.Tools import ar, d
|
||||||
from waflib.Tools import ar, d, ccroot
|
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
|
|
||||||
ccroot.USELIB_VARS['dstlib'].add('D2LINKFLAGS')
|
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def find_dmd(conf):
|
def find_dmd(conf):
|
||||||
"""
|
"""
|
||||||
|
@ -63,48 +60,17 @@ def common_flags_dmd(conf):
|
||||||
v.DFLAGS_d_with_header = ['-H', '-Hf']
|
v.DFLAGS_d_with_header = ['-H', '-Hf']
|
||||||
v['D_HDR_F'] = '%s'
|
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):
|
def configure(conf):
|
||||||
"""
|
"""
|
||||||
Configuration for dmd/ldc
|
Configuration for dmd/ldc
|
||||||
"""
|
"""
|
||||||
conf.find_dmd()
|
conf.find_dmd()
|
||||||
|
|
||||||
|
if sys.platform == 'win32':
|
||||||
out = conf.cmd_and_log([conf.env.D, '--help'])
|
out = conf.cmd_and_log([conf.env.D, '--help'])
|
||||||
if out.find("D Compiler v2.") > -1:
|
if out.find("D Compiler v2.") > -1:
|
||||||
conf.env.D2 = 1
|
conf.fatal('dmd2 on Windows is not supported, use gdc or ldc instead')
|
||||||
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'
|
|
||||||
|
|
||||||
conf.env.D2LINKFLAGS_dstlib = ['-lib']
|
|
||||||
#conf.env.DSTLIBPATH_ST = '-L%s'
|
|
||||||
conf.env.DSTLIB_ST = '-l'
|
|
||||||
conf.env.DINC_ST = '-I%s'
|
|
||||||
|
|
||||||
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('ar')
|
||||||
conf.load('d')
|
conf.load('d')
|
||||||
conf.common_flags_dmd()
|
conf.common_flags_dmd()
|
||||||
|
|
Loading…
Reference in New Issue