Re: 64-bit build option?
Warren Young <[email protected]> Tue, 24 Feb 2009 03:43:13 -0700
| Newsgroups | gmane.comp.sysutils.bakefile.devel |
|---|---|
| Message-ID | <[email protected]> |
Vaclav Slavik wrote:
>
> through MSVS_PLATFORMS variable, extending it to handle x64
> too shouldn't be too much work.
>
> In fact, it seems trivial:
Not quite there yet. All the modules in my library compile, but then I
get this for each module in the library:
> fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
Removing the x64 configuration and re-adding it using Visual Studio
doesn't fix the problem.
If I go back to the previous way, building only 32-bit project files and
then forking the 32-bit configuration to add a 64-bit one, I get many
diffs of this form in *.vcproj:
> - ImportLibrary="$(PlatformName)\$(ConfigurationName)\mysqlpp.lib"
> + ImportLibrary="$(SolutionDir)$(ConfigurationName)\mysqlpp.lib"
Although the diff output is copious, it's all just repeats of the same
basic pattern: "$(PlatformName)\" vs. "$(SolutionDir)"
When you add the 64-bit build configuration through the GUI, VC++ puts
32-bit debug build outputs in Debug, but 64-bit outputs in x64\Debug.
The Bakefile way seems more sensible, giving Win32\Debug and x64\Debug,
but maybe there's some limitation in Visual Studio that requires the
other arrangement.
Another difficulty I'm running into is that with a hybrid project file,
how are you supposed to reference different libraries based on the CPU
type? The CRT issues are taken care of by the IDE, but what about
third-party libraries?
Take MySQL++, for example. It depends on the MySQL C API libraries,
naturally. When you install the 32-bit version of MySQL on Vista 64, it
goes in c:\Program Files (x86)\MySQL... Note the " (x86)" This is good
because you will also need the 64-bit version of MySQL, which uses all
the same file names, but goes in c:\Program Files\MySQL..., so the two
sets of binaries don't conflict. The thing is, though, how do I tell
Bakefile about this?
Currently, I have this:
<set var="MYSQL_WIN_DIR">
C:\Program Files\MySQL\MySQL Server 5.1
</set>
...
<include>$(MYSQL_WIN_DIR)\include</include>
<lib-path>$(MYSQL_WIN_DIR)\lib\opt</lib-path>
...etc...
Is there a way to set this variable conditionally based on the CPU
target, two different ways for a given Bakefile target type? It needs
to be set two different ways for msvs200[58]prj, one way when generating
the Win32 parts of *.vcproj and *.sln, and a different way for the Win64
parts.
> running Bakefile
> with -DMSVS_PLATFORMS=win32,win64 should generate hybrid project file
> for both 32bit and 64bit builds (msvs200{5,8}prj formats only).
Adding this to Bakefiles.bkgen isn't a hardship, but I wonder if it
shouldn't be the default, at least during this time of transition.
------------------------------------------------------------------------------
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