[Scons-dev] SCons building with MS Visual C++10 on 64-bit Windows.

Gary Oberbrunner garyo at oberbrunner.com
Fri Jun 15 10:53:24 EDT 2012


On Fri, Jun 15, 2012 at 9:59 AM, Edward d'Auvergne <edward at nmr-relax.com> wrote:

> I want to build 32-bit modules anyway, so that the Windows users of my

> software (http://www.nmr-relax.com) can all use the same binary

> distribution.


I just noticed this part of your email -- you *always* want to do a
32-bit build, right? In that case you should just set
env['TARGET_ARCH']='x86' and it should all work fine. Looking at the
doc for TARGET_ARCH, it says this:

TARGET_ARCH
Sets the target architecture for Visual Studio compiler (i.e. the arch
of the binaries generated by the compiler). If not set, default to
$HOST_ARCH, or, if that is unset, to the architecture of the running
machine's OS (note that the python build or architecture has no
effect). This variable must be passed as an argument to the
Environment() constructor; setting it later has no effect. This is
currently only used on Windows, but in the future it will be used on
other OSes as well.
Valid values for Windows are x86, i386 (for 32 bits); amd64, emt64,
x86_64 (for 64 bits); and ia64 (Itanium). For example, if you want to
compile 64-bit binaries, you would set TARGET_ARCH='x86_64' in your
SCons environment.

and HOST_ARCH defaults to your machine's actual OS architecture, which
I'm guessing is 64 bit in your case. So other than the error handling
(which I agree is poor, and we've had discussions about that -- for
another email) it's working as designed. SCons will always honor
TARGET_ARCH, and not go off and build something else other than what
you wanted. What might be missing for some users is a way to say "I
don't really care whether you build 32 or 64, but build something that
works." But in your case I still think setting TARGET_ARCH is right.

--
Gary


More information about the Scons-dev mailing list