Add a build variable collect_metrics to the scons build.
authorRalph Giles <giles@xiph.org>
Tue, 30 Nov 2010 19:32:31 +0000 (19:32 +0000)
committerRalph Giles <giles@xiph.org>
Tue, 30 Nov 2010 19:32:31 +0000 (19:32 +0000)
Invoking the build with 'scons collect_metrics=1' will
compile the library -DOC_COLLECT_METRICS, which enables
recording training metrics.

svn path=/trunk/theora/; revision=17692

SConstruct

index c8dc61d..8dde3d6 100644 (file)
@@ -46,6 +46,12 @@ env = Environment()
 if env['CC'] == 'gcc':
   env.Append(CCFLAGS=["-g", "-O2", "-Wall", "-Wno-parentheses"])
 
+# pass collect_metrics=1 on the scons command line
+# to enable metrics collection for mode training.
+collect_metrics = ARGUMENTS.get('collect_metrics', 0)
+if int(collect_metrics):
+  env.Append(CPPDEFINES=['OC_COLLECT_METRICS'])
+
 def CheckPKGConfig(context, version): 
   context.Message( 'Checking for pkg-config... ' ) 
   ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0]