Fix Windows build when not using precompiled headers

Should we turn of precompiled headers in our Release builds???
This commit is contained in:
Leland Lucius 2020-07-25 15:34:33 -05:00
parent e07320be9e
commit 8f1e52c1c2
3 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -58,6 +58,9 @@ extern AUDACITY_DLL_API const wxString& GetCustomSubstitution(const wxString& st
#ifdef __WXMSW__
// Eventually pulls in <windows.h> which indirectly defines DebugBreak(). Can't
// include <windows.h> directly since it then causes "MemoryX.h" to spew errors.
#include <wx/app.h>
#define _(s) ((wxTranslations::Get() || (DebugBreak(), true)), \
GetCustomTranslation((s)))

View File

@ -8,7 +8,6 @@
#define safenew new
#endif
#include <functional>
#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 <wx/any.h>
#endif
#endif
template<typename X>
class Optional {