OSDN Git Service

nvdaHelper sconstruct file: add a targetArchitectures commandline variable which...
authorMichael Curran <mick@kulgan.net>
Thu, 30 Sep 2010 21:47:49 +0000 (07:47 +1000)
committerMichael Curran <mick@kulgan.net>
Thu, 30 Sep 2010 21:47:49 +0000 (07:47 +1000)
source/NVDAHelper/building.txt
source/NVDAHelper/sconstruct

index a54a0c9..09cc81f 100644 (file)
@@ -34,4 +34,12 @@ scons install
 By default a version with debugging symbols will be generated. To build a release version, provide release=1 on the command line when running scons:\r
 scons install release=1\r
 \r
-Note that now both x86 and x64 versions of the libraries are automatically built, there is no need to supply any target arch variables.\r
+Note that now both x86 and x64 versions of the libraries are automatically built, there is no need to supply any target arch variables by default.\r
+\r
+However, if you specifically only want to build certain architectures, you can provide a comma separated list of the required architectures to the targetArchitectures variable on the commandline, like so:\r
+scons targetArchitectures=x86\r
+or\r
+scons targetArchitectures=x86_64\r
+or\r
+scons targetArchitectures=x86,x86_64\r
\ No newline at end of file
index b6bcd2c..6490a3e 100644 (file)
 #http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\r
 ###\r
 \r
+defaultTargetArchitectures=['x86','x86_64']\r
+\r
 #User build variables\r
 vars=Variables()\r
 vars.Add(BoolVariable('release','Set to true to build a release version',False))\r
 vars.Add(EnumVariable('logLevel','The level of logging you wish to see, lower is more verbose','15',allowed_values=[str(x) for x in xrange(60)]))\r
+vars.Add(ListVariable('targetArchitectures','Which architectures  to build libraries for','all',defaultTargetArchitectures))\r
+\r
+#A very simple base environment only for processing variables\r
+baseEnv=Environment(tools=[],variables=vars)\r
+\r
+#Check for any unknown variables\r
+unknown=vars.UnknownVariables().keys()\r
+if len(unknown)>0:\r
+       print "Unknown commandline variables: %s"%unknown\r
+       Exit(1)\r
 \r
 #Build nvdaHelper for needed architectures\r
-for arch in ('x86','x86_64'):\r
+for arch in baseEnv['targetArchitectures']: \r
        try:\r
-               env=Environment(TARGET_ARCH=arch,tools=['windowsSdk','midl','msrpc','boost','default'],variables=vars)\r
+               env=baseEnv.Clone(TARGET_ARCH=arch,tools=['windowsSdk','midl','msrpc','boost','default'],variables=vars)\r
                print "Building for %s"%arch \r
        except:\r
                print "Error setting up %s build environment"%arch \r