From 8f1e52c1c27e246b9c1e1c8f9b42d6eb3fd40af1 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Sat, 25 Jul 2020 15:34:33 -0500 Subject: [PATCH] Fix Windows build when not using precompiled headers Should we turn of precompiled headers in our Release builds??? --- .github/workflows/cmake_build.yml | 5 +++-- src/Internat.h | 3 +++ src/MemoryX.h | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake_build.yml b/.github/workflows/cmake_build.yml index d13ab7859..f23a88fdd 100644 --- a/.github/workflows/cmake_build.yml +++ b/.github/workflows/cmake_build.yml @@ -146,14 +146,15 @@ jobs: # on Github, we only build the Release version of # wxWidgets and the FindwxWidgets CMake module # defaults to looking for both. If either of them - # isn't found, then it doesn't provides the required + # isn't found, then it doesn't provided the required # library information. This is only a concern for # Windows. cmake -S . \ -B build \ -G "${{matrix.config.generator}}" \ -A ${{matrix.config.platform}} \ - -D wxWidgets_USE_REL_AND_DBG=NO + -D wxWidgets_USE_REL_AND_DBG=no \ + -D audacity_use_pch=no # Build Audacity cmake --build build --config Release --verbose diff --git a/src/Internat.h b/src/Internat.h index 1540dbb2d..140cc1cd1 100644 --- a/src/Internat.h +++ b/src/Internat.h @@ -58,6 +58,9 @@ extern AUDACITY_DLL_API const wxString& GetCustomSubstitution(const wxString& st #ifdef __WXMSW__ + // Eventually pulls in which indirectly defines DebugBreak(). Can't + // include directly since it then causes "MemoryX.h" to spew errors. + #include #define _(s) ((wxTranslations::Get() || (DebugBreak(), true)), \ GetCustomTranslation((s))) diff --git a/src/MemoryX.h b/src/MemoryX.h index 04bba44d5..07735ebd3 100644 --- a/src/MemoryX.h +++ b/src/MemoryX.h @@ -8,7 +8,6 @@ #define safenew new #endif - #include #if !(_MSC_VER >= 1800 || __cplusplus >= 201402L) @@ -200,9 +199,12 @@ public: #ifdef _DEBUG #ifdef _MSC_VER #undef new -#endif -#endif +// wx/any.h also uses Placement-NEW so include it before redefining "new" at comment: +// "Restore definition of debug new" +#include +#endif +#endif template class Optional {