waf

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

wscript (980B)


      1 #! /usr/bin/env python
      2 
      3 ##
      4 # This wscript shows the power of the CLI!
      5 # You have an hello.exe using a world.dll,
      6 # the world.dll can be generating using
      7 # world.cs (in C#) or world.boo.
      8 
      9 top = '.'
     10 out = 'build'
     11 
     12 def options(opt):
     13 	opt.load('cs')
     14 	opt.add_option("--use-cs", dest="use_cs", action="store_true",
     15 		help="use world.cs to generate world.dll")
     16 
     17 def configure(conf):
     18 	conf.env.USE_CS = conf.options.use_cs
     19 	if conf.env.USE_CS:
     20 		conf.load('cs')
     21 	conf.load('boo')
     22 
     23 def build(bld):
     24 	if bld.env.USE_CS:
     25 		# C# world library
     26 		bld(features = "cs",
     27 			source   = "world.cs",
     28 			type     = "library",
     29 			gen      = "world.dll",
     30 			name     = "world"
     31 		)
     32 
     33 	else:
     34 		# boo world library
     35 		bld(features = "boo",
     36 			source   = "world.boo",
     37 			type     = "library",
     38 			gen      = "world.dll",
     39 			name     = "world"
     40 		)
     41 
     42 	# executable that uses the world library
     43 	bld(features = "boo",
     44 		source   = "hello.boo",
     45 		type     = "exe",
     46 		gen      = "hello.exe",
     47 		use      = "world"
     48 	)
     49