Skip to content

Commit

Permalink
Generate an error when the CPU parameter is not specified and cannot …
Browse files Browse the repository at this point in the history
…be determined

See wxWidgets#18640
  • Loading branch information
MaartenBent committed Mar 27, 2020
1 parent 284b25c commit f1a0175
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/bakefiles/common.bkl
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@
</set>
</if>

<set var="TARGET_CPU_COMPFLAG"></set>
<if cond="FORMAT=='msvc'">
<set var="TARGET_CPU_COMPFLAG">
<if cond="TARGET_CPU==''">TARGET_CPU_COMPFLAG=0</if>
<if cond="TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='x64'"></if>
<if cond="TARGET_CPU=='' and VISUALSTUDIOPLATFORM=='X64'"></if>
</set>
</if>

<template id="common_settings">
<debug-info>$(DEBUGINFO)</debug-info>
<debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
Expand Down Expand Up @@ -423,6 +432,7 @@
<ldflags>$(WIN32_DPI_LINKFLAG)</ldflags>
<if cond="FORMAT=='msvc'">
<ldflags>$(LINK_TARGET_CPU)</ldflags>
<define>$(TARGET_CPU_COMPFLAG)</define>
</if>
</template>

Expand Down
7 changes: 7 additions & 0 deletions include/wx/msw/chkconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
#ifndef _WX_MSW_CHKCONF_H_
#define _WX_MSW_CHKCONF_H_

/* ensure that CPU parameter is specified (only nmake .vc makefile) */
#ifdef _MSC_VER
#if defined(_WIN64) && defined(TARGET_CPU_COMPFLAG) && (TARGET_CPU_COMPFLAG == 0)
#error CPU must be defined
#endif
#endif

/* ensure that MSW-specific settings are defined */
#ifndef wxUSE_ACTIVEX
# ifdef wxABORT_ON_CONFIG_ERROR
Expand Down

0 comments on commit f1a0175

Please sign in to comment.