Commits

zougloub committed 4b0a2a6

wscript: allow selecting which core tools to use (saves 31k for C/C++ only)

By default, everything is included.

Comments (0)

Files changed (1)

 		dest='strip_comments')
 	opt.add_option('--tools', action='store', help='Comma-separated 3rd party tools to add, eg: "compat,ocaml" [Default: "compat15"]',
 		dest='add3rdparty', default='compat15')
+	opt.add_option('--coretools', action='store', help='Comma-separated core tools to add, eg: "vala,tex" [Default: all of them]',
+		dest='coretools', default='default')
 	opt.add_option('--prelude', action='store', help='Code to execute before calling waf', dest='prelude', default=PRELUDE)
 	opt.load('python')
 
 		else:
 			add3rdparty.append(x + '.py')
 
+	coretools = []
+	for x in Options.options.coretools.split(','):
+		coretools.append(x + '.py')
+
 	for d in '. Tools extras'.split():
 		dd = os.path.join('waflib', d)
 		for k in os.listdir(dd):
 			if k == '__init__.py':
 				files.append(os.path.join(dd, k))
 				continue
+			if d == 'Tools' and Options.options.coretools != 'default':
+				if not k in coretools:
+					continue
 			if d == 'extras':
 				if not k in add3rdparty:
 					continue