waf

FORK: waf with some random patches
git clone https://git.neptards.moe/neptards/waf.git
Log | Files | Refs | README

wscript (1403B)


      1 from waflib.TaskGen import feature
      2 
      3 def configure(ctx):
      4     ctx.load('clang_cl')
      5     ctx.env.CFLAGS.extend(['/EHsc', '/O12', '/TC', '/GL', '/w', '/U __llvm__'])
      6     for lib in ['msvcrt']:
      7         ctx.check(
      8             compiler='c',
      9             lib=lib,
     10             uselib_store='SYSTEM')
     11     for lib in ['libhl']:
     12         ctx.check(
     13             compiler='c',
     14             lib=lib,
     15             use='HL',
     16             uselib_store='HL')
     17 
     18 def build(ctx):
     19     ctx.env.LINKFLAGS.extend(['/NODEFAULTLIB:libcmt'])
     20     ctx.program(
     21         source = ['waf/src/main.c'],
     22         includes = [ctx.env.ROOT_INCLUDE_DIR],
     23         target = 'app',
     24         use = ['SYSTEM', 'HL'])
     25 
     26 @feature('cxxprogram', 'cprogram')
     27 def call_me_static(self):
     28     attr_name = 'source'
     29     attr = getattr(self, attr_name, [])
     30     if len(attr):
     31         setattr(self, attr_name, [])
     32         for x in self.to_list(attr):
     33             node = self.path.make_node(x)
     34             tg = self.bld.get_tgen_by_name(node.name)
     35             if not tg:
     36                 self.bld.fatal('Could not find a task generator by the name %r' % x)
     37             tg.post()
     38             for tsk in tg.tasks:
     39                 for out in tsk.outputs:
     40                     if out.name.endswith('.c'):
     41                         self.create_compiled_task('c', out)
     42         if not self.compiled_tasks:
     43             self.fatal('Could not find a source file for for %r' % self.name)