Re: 64-bit build option?

Vaclav Slavik <[email protected]> Tue, 24 Feb 2009 10:28:18 +0100
Newsgroups gmane.comp.sysutils.bakefile.devel
Message-ID <1235467698.11431.16.camel@localhost>
Hi,

On Tue, 2009-02-24 at 01:58 -0700, Warren Young wrote:
> > What about the WIN32 preprocessor symbol that VC++ normally defines (see
> > related Bakefile fix: http://www.bakefile.org/changeset/1284)? Is it
> > still defined, is it replaced with WIN64 or something else?
> 
> Yes, WIN32 is still defined for a 64-bit build.  

Makes sense, it's analogous to _WIN32/_WIN64 defined by the compiler --
the former is defined for both, see
http://msdn.microsoft.com/en-us/library/b0084kay.aspx

> away in VC++ 2010.  Personally, I would expect to test only _WINDOWS or 
> WIN64 as predefined symbols if I knew I was supporting 64-bit platforms.

Better yet, test _WIN64.

> I think I was wrong to suggest making it an either/or option.  

I agree. There's already support for multiple platforms (Win32 and
PocketPC) through MSVS_PLATFORMS variable, extending it to handle x64
too shouldn't be too much work.

In fact, it seems trivial: with the attached patch, running Bakefile
with -DMSVS_PLATFORMS=win32,win64 should generate hybrid project file
for both 32bit and 64bit builds (msvs200{5,8}prj formats only).

> It's not clear to me what the options are with MinGW, though.

http://mingw-w64.sourceforge.net/

Regards,
Vaclav

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

_______________________________________________
Bakefile-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bakefile-devel
bkl-msvs2005-x64.patch (text/x-patch, 1.3 KB)
Index: rules/msvs2005prj.bkl
===================================================================
--- rules/msvs2005prj.bkl	(revision 1284)
+++ rules/msvs2005prj.bkl	(working copy)
@@ -37,6 +37,7 @@
          by default, only PC Win32 targets are generated. Allowed values are:
 
          "win32"                    - Win32
+         "win64"                    - x64
          "pocketpc2003"             - Pocket PC 2003 (ARMV4)
       -->
     <set var="MSVS_PLATFORMS" overwrite="0">win32</set>
@@ -45,6 +46,7 @@
         $(','.join([substituteFromDict(x,
                     {
                        'win32'        : 'Win32',
+                       'win64'        : 'x64',
                        'pocketpc2003' : 'Pocket PC 2003 (ARMV4)',
                      })
                    for x in MSVS_PLATFORMS.split(',')]))
Index: output/msvs200xprj.py
===================================================================
--- output/msvs200xprj.py	(revision 1286)
+++ output/msvs200xprj.py	(working copy)
@@ -278,7 +278,7 @@
     def isEmbeddedConfig(self, config):
         """Returns true if given config targets embedded device."""
         cfg = configs[config][0]['MSVS_PLATFORM']
-        return cfg != 'win32'
+        return cfg == 'pocketpc2003'
 
 
     def assignGUIDs(self, sln_targets):
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEABECAAYFAkmjvbIACgkQxDYa/UZSZMlVbACeOaIvp+rJKrh4NZWtA1zWy40o
BZgAn2RX7FtfQCVWfD49r/jP7QZGfwxR
=Ip8O
-----END PGP SIGNATURE-----