Răsfoiți Sursa

SConstruc can parse my options

tanghai 15 ani în urmă
părinte
comite
32b9ffdf5e
1 a modificat fișierele cu 16 adăugiri și 1 ștergeri
  1. 16 1
      SConstruct

+ 16 - 1
SConstruct

@@ -1,3 +1,18 @@
 env = DefaultEnvironment()
 
-Export('env')
+def ParseOptions():
+	AddOption('--mode',
+		dest='mode',
+		type='string',
+		nargs=1,
+		action='store',
+		default='dbg',
+		help='build in dbg or opt mode')
+	env['mode'] = GetOption('mode')
+
+ParseOptions()
+
+Export('env')
+
+SConscript('src/SConscript' % x, build_dir=target_dir)
+