add 64bit support to those formats which I could test and which support 64bit build modes (msvc, msvs2005prj and msvs2008prj) by adding a TARGET_CPU option similar to what wxWidgets bakefiles do (note the absence of the WX_ prefix since it does not make sense to have a wx-specific architecture); this additional feature allows correct inclusion of the vc_[amd64|ia64]_[lib|dll] path when building a wx-based project on Windows.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2010-03-03 00:35:44 +00:00
parent 56bcdffdc3
commit 617bcbe241

View File

@@ -13,26 +13,45 @@
<makefile> <makefile>
<!-- -->
<!-- OPTIONS --> <!-- OPTIONS -->
<!-- --> <!-- -->
<!-- These are essentially the configurations you -->
<!-- want in bakefile. --> <set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL">
<!-- --> <!-- 'NORMAL' here refers to the fact that the formats for which
<!-- In MSVC these are the different build --> FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL==1 only need
<!-- configurations you can have (in the build menu), --> additional compiler and/or linker flags (see e.g. WXMACHINE_FLAG)
<!-- and in autoconf is enabled with enable-xxx=xx. --> -->
<!-- For other compilers a separate configuration --> <if cond="FORMAT in ['msvc']">1</if>
<!-- file is created (such as config.gcc on gcc) --> <if cond="FORMAT not in ['msvc']">0</if>
<!-- which has several options a user can modify. --> </set>
<!-- --> <set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS">
<!-- Note that the above only happens if an option --> <!-- the formats for which FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS==1
<!-- is not constant, i.e. if it cannot be determined --> need special handling: see the docs of the MSVS_PLATFORMS variable in Bakefile docs.
<!-- by bakefile itself. --> -->
<!-- Also note that for 'autoconf' format these options --> <if cond="FORMAT in ['msvs2005prj','msvs2008prj']">1</if>
<!-- are only useful when used together with wxpresets.m4 --> <if cond="FORMAT not in ['msvs2005prj','msvs2008prj']">0</if>
<!-- macro file which contains macros for detecting the --> </set>
<!-- option values for wx-based projects. See wxpresets.m4 --> <set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES">
<!-- comments for more info. --> <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1'">1</if>
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='1'">1</if>
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='0' and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='0'">0</if>
</set>
<!-- This is a standard option that determines -->
<!-- the architecture for which the lib/exe/dll later -->
<!-- declared are meant. -->
<if cond="not isdefined('TARGET_CPU') and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1'">
<set var="TARGET_CPU_DEFAULT" overwrite="0">X86</set>
<option name="TARGET_CPU">
<values>X86,AMD64,IA64</values>
<values-description>i386-compatible,AMD 64 bit,Itanium 64 bit</values-description>
<default-value>$(TARGET_CPU_DEFAULT)</default-value>
<description>
Architecture of the CPU for which to build the executables and libraries
</description>
</option>
</if>
@@ -63,13 +82,26 @@
<set var="WXCPU"> <set var="WXCPU">
<if cond="FORMAT=='msevc4prj'">_$(CPU)</if> <if cond="FORMAT=='msevc4prj'">_$(CPU)</if>
<!-- just define the correct string for those formats which support the 'TARGET_CPU' option: -->
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='AMD64'">_amd64</if>
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='IA64'">_ia64</if>
<!-- for MSVS projects instead of the 'TARGET_CPU' option we need to use the 'MSVS_PLATFORM' variable: -->
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='1' and MSVS_PLATFORM=='win64'">_amd64</if>
</set> </set>
<set var="WXMACHINE_FLAG">
<!-- add the /MACHINE linker flag to formats with "normal" multiple-arch support when building in 64bit mode: -->
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='AMD64'">/MACHINE:AMD64</if>
<if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='IA64'">/MACHINE:IA64</if>
</set>
<set var="WXLIBPATH"> <set var="WXLIBPATH">
<if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_lib</if> <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_lib</if>
<if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_dll</if> <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_dll</if>
</set> </set>
<!-- under Unix this is an option (detected at configure-time); <!-- under Unix this is an option (detected at configure-time);
under Windows this is not an user option! --> under Windows this is not an user option! -->
<set var="WX_PORT"> <set var="WX_PORT">
@@ -266,6 +298,8 @@
<lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path> <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path>
</if> </if>
<ldflags>$(WXMACHINE_FLAG)</ldflags>
<!-- wx libs must come before 3rd party and sys libs, this is <!-- wx libs must come before 3rd party and sys libs, this is
the place where the hack explained above is carried on: --> the place where the hack explained above is carried on: -->
<__wx-libs-point/> <__wx-libs-point/>