CPU architecture detection (32bit / 64bit) in scons?

Are there "standard" plugins for detecting processor architecture in scons ?

By the way, this question was already asked here in a more general form ... it's just interesting, someone has already taken the time to include this information in scons.

+4
source share
2 answers

Using i386 is more likely to depend on the compiler and will not detect 32-bit non x86 arches. Assuming that the python interpreter used by scons runs on the processor of interest to you (not always in the case of cross-compilation), you can simply use python itself.

import platform print platform.machine() print platform.architecture() 

If you need something more complex, then you may have to write your own customization function, but it's better to deal with it directly in your code.

+6
source

Something like that?

 env = Environment() conf = Configure(env) if conf.CheckDeclaration("__i386__"): conf.Define("MY_ARCH", "blahblablah") env = conf.Finish() 
+2
source

All Articles