Automatically detect if target architecture is x64 in .vc file

This allows a successful build even if the user omits specifying CPU=X64.

See #18640
This commit is contained in:
Maarten Bent
2020-03-26 22:22:33 +01:00
parent 3c53fbb94b
commit 284b25ce02
2 changed files with 22 additions and 0 deletions

View File

@@ -43,6 +43,8 @@
<if cond="TARGET_CPU=='IA64'">_ia64</if>
<if cond="TARGET_CPU=='x64'">_x64</if>
<if cond="TARGET_CPU=='X64'">_x64</if>
<if cond="FORMAT=='msvc' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">_x64</if>
<if cond="FORMAT=='msvc' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">_x64</if>
</set>
<!-- ================================================================== -->
@@ -326,6 +328,8 @@
<if cond="TARGET_CPU=='IA64'">/MACHINE:IA64</if>
<if cond="TARGET_CPU=='x64'">/MACHINE:X64</if>
<if cond="TARGET_CPU=='X64'">/MACHINE:X64</if>
<if cond="FORMAT=='msvc' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">/MACHINE:X64</if>
<if cond="FORMAT=='msvc' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">/MACHINE:X64</if>
</set>
<set var="WIN32_DPI_LINKFLAG"></set>
@@ -360,6 +364,12 @@
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='14.0' and TARGET_CPU=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='15.0' and TARGET_CPU=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='16.0' and TARGET_CPU=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='14.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='15.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='16.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='14.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='15.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='1' and VISUALSTUDIOVERSION=='16.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware.manifest</if>
<!-- 32-bit per-monitor dpi -->
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='14.0' and TARGET_CPU==''">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/wx_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='15.0' and TARGET_CPU==''">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/wx_dpi_aware_pmv2.manifest</if>
@@ -377,6 +387,12 @@
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='14.0' and TARGET_CPU=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='15.0' and TARGET_CPU=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='16.0' and TARGET_CPU=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='14.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='15.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='16.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='14.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='15.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
<if cond="USE_DPI_AWARE_MANIFEST=='2' and VISUALSTUDIOVERSION=='16.0' and TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'">/MANIFEST:EMBED /MANIFESTINPUT:$(TOP_SRCDIR)include/wx/msw/amd64_dpi_aware_pmv2.manifest</if>
</set>
</if>

View File

@@ -138,6 +138,12 @@ Accepted values: IA64, X64, ARM64
Visual Studio version set by the VS command prompt.
</description>
</option>
<option name="VISUALSTUDIOPLATFORM">
<default-value>$(DOLLAR)(PLATFORM)</default-value>
<description>
Platform architecture set by the VS command prompt.
</description>
</option>
</if>
<if cond="FORMAT!='msvc'">
<set var="TARGET_CPU"/>