From 21cc95e24618c6017f17a02e71afaf0d2aa58260 Mon Sep 17 00:00:00 2001 From: Cheng Date: Thu, 22 Feb 2024 12:44:30 +0000 Subject: [PATCH] building wxWidgets as a cmake project file instead of visual studio project file --- msvc/wx_cmake_Debug.bat | 55 +++++++++++++++++++++++++++++++++++++ msvc/wx_cmake_Release.bat | 57 +++++++++++++++++++++++++++++++++++++++ msvc/wx_msvc_Debug.bat | 45 ++++++++++++++----------------- src/stdafx.h | 6 ++--- wxWidgets | 2 +- 5 files changed, 136 insertions(+), 29 deletions(-) create mode 100644 msvc/wx_cmake_Debug.bat create mode 100644 msvc/wx_cmake_Release.bat diff --git a/msvc/wx_cmake_Debug.bat b/msvc/wx_cmake_Debug.bat new file mode 100644 index 0000000..f59907d --- /dev/null +++ b/msvc/wx_cmake_Debug.bat @@ -0,0 +1,55 @@ +echo off +call C:\"Program Files (x86)"\"Microsoft Visual Studio"\2022\BuildTools\VC\Auxiliary\Build\vcvarsamd64_x86.bat +call C:\"Program Files"\"Microsoft Visual Studio"\2022\Community\VC\Auxiliary\Build\vcvars64.bat" + +echo on +rmdir /Q /S build +rmdir /Q /S msvc\.vs +cd wxWidgets +del lib\wxWidgetsConfig.cmake +del lib\wxWidgetsConfigVersion.cmake +rmdir /Q /S build\msw\vc_x64_mswu +rmdir /Q /S lib\vc_x64_lib +cd .. +rem echo check to see that everything is cleaned +rem git clean -xdn +rem cd wxWidgets +rem git clean -xdn +rem cd .. +rem PAUSE + +cd wxWidgets +cmake . -Bbuild\msw\vc_x64_mswu -DwxBUILD_SHARED=OFF -DwxBUILD_TESTS=OFF -DwxBUILD_SAMPLES=OFF -DwxUSE_ACCESSIBILITY=OFF -DwxUSE_UNSAFE_WXSTRING_CONV=ON -DwxUSE_COMPILER_TLS=2 +echo off +IF %ERRORLEVEL% NEQ 0 ( + echo Failed during cmake create build directory + PAUSE + GOTO:EOF +) +echo on +cd build\msw\vc_x64_mswu +cmake --build . --config Debug +IF %ERRORLEVEL% NEQ 0 ( + echo Failed during cmake --build . + PAUSE + GOTO:EOF +) +echo on +xcopy /E /F /Y lib ..\..\..\lib +cd ..\..\.. +cd .. + +msbuild msvc/wallet.sln -p:Configuration=Debug;Platform=x64 -m +echo off +IF %ERRORLEVEL% NEQ 0 ( + PAUSE + GOTO:EOF +) +echo on +.\build\Debug\wallet.exe --complete --test +echo off +IF %ERRORLEVEL% NEQ 0 ( + echo failed unit test on debug build +) ELSE ( + echo passed unit test on debug build +) diff --git a/msvc/wx_cmake_Release.bat b/msvc/wx_cmake_Release.bat new file mode 100644 index 0000000..f49f628 --- /dev/null +++ b/msvc/wx_cmake_Release.bat @@ -0,0 +1,57 @@ +echo off +call C:\"Program Files (x86)"\"Microsoft Visual Studio"\2022\BuildTools\VC\Auxiliary\Build\vcvarsamd64_x86.bat +call C:\"Program Files"\"Microsoft Visual Studio"\2022\Community\VC\Auxiliary\Build\vcvars64.bat" + +echo on +rmdir /Q /S build +rmdir /Q /S msvc\.vs +cd wxWidgets +del lib\wxWidgetsConfig.cmake +del lib\wxWidgetsConfigVersion.cmake +rmdir /Q /S build\msw\vc_x64_mswu +rmdir /Q /S build\msw\vc_x64_mswud +rmdir /Q /S lib\vc_x64_lib +cd .. +rem echo check to see that everything is cleaned +rem git clean -xdn +rem cd wxWidgets +rem git clean -xdn +rem cd .. +rem PAUSE + +cd wxWidgets +cmake -DwxBUILD_SHARED=OFF -DwxBUILD_TESTS=OFF -DwxBUILD_SAMPLES=OFF -DwxUSE_ACCESSIBILITY=OFF . -Bbuild\msw\vc_x64_mswu +echo off +IF %ERRORLEVEL% NEQ 0 ( + echo Failed during cmake create build directory + PAUSE + GOTO:EOF +) +echo on +cd build\msw\vc_x64_mswu +cmake --build . --config Release +echo off +IF %ERRORLEVEL% NEQ 0 ( + echo Failed during cmake --build . + PAUSE + GOTO:EOF +) +echo on +xcopy /E /F /Y lib ..\..\..\lib +cd ..\..\.. +cd .. + +msbuild msvc/wallet.sln -p:Configuration=Release;Platform=x64 -m +echo off +IF %ERRORLEVEL% NEQ 0 ( + PAUSE + GOTO:EOF +) +echo on +.\build\Release\wallet.exe --complete --test +echo off +IF %ERRORLEVEL% NEQ 0 ( + echo failed unit test on release build +) ELSE ( + echo passed unit test on release build +) diff --git a/msvc/wx_msvc_Debug.bat b/msvc/wx_msvc_Debug.bat index 5d705d4..88a3a63 100644 --- a/msvc/wx_msvc_Debug.bat +++ b/msvc/wx_msvc_Debug.bat @@ -1,32 +1,34 @@ -echo on +echo off call C:\"Program Files (x86)"\"Microsoft Visual Studio"\2022\BuildTools\VC\Auxiliary\Build\vcvarsamd64_x86.bat call C:\"Program Files"\"Microsoft Visual Studio"\2022\Community\VC\Auxiliary\Build\vcvars64.bat" + +echo on +rmdir /Q /S build +rmdir /Q /S msvc\.vs +cd wxWidgets +rmdir /Q /S build\msw\vc_x64_mswu +rmdir /Q /S build\msw\vc_x64_mswud +rmdir /Q /S lib\vc_x64_lib +cd .. +echo check to see that everything is cleaned +git clean -xdn +cd wxWidgets +git clean -xdn +cd .. +PAUSE + + echo on cd wxWidgets\build\msw -msbuild wx_vc17.sln -m -p:Configuration=Release;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 -echo off -IF %ERRORLEVEL% NEQ 0 ( - PAUSE - GOTO:EOF -) -echo on msbuild wx_vc17.sln -m -p:Configuration=Debug;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 echo off IF %ERRORLEVEL% NEQ 0 ( PAUSE GOTO:EOF ) - echo on cd ..\..\.. -msbuild wallet.sln -p:Configuration=Debug;Platform=x64 -m -echo off -IF %ERRORLEVEL% NEQ 0 ( - PAUSE - GOTO:EOF -) -echo on -msbuild wallet.sln -p:Configuration=Release;Platform=x64 -m +msbuild msvc/wallet.sln -p:Configuration=Debug;Platform=x64 -m echo off IF %ERRORLEVEL% NEQ 0 ( PAUSE @@ -38,12 +40,5 @@ echo off IF %ERRORLEVEL% NEQ 0 ( echo failed unit test on debug build ) ELSE ( - echo passed unit test on debug build) -echo on -.\build\Release\wallet.exe --complete --test -echo off -IF %ERRORLEVEL% NEQ 0 ( - echo failed unit test on release build -) ELSE ( - echo passed unit test on release build + echo passed unit test on debug build ) diff --git a/src/stdafx.h b/src/stdafx.h index ee0964b..558ff2e 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -66,10 +66,10 @@ R"(In fully utf environment, (wallet.manifest plus static_assert(wxUSE_IPV6 == 1, "IP6 unavailable in wxWidgets"); static_assert(WXWIN_COMPATIBILITY_3_0 == 0, "wxWidgets api out of date"); static_assert(wxUSE_COMPILER_TLS == (b_WINDOWS ? 2 : 1), "out of date workarounds in wxWidgets for windows bugs"); -static_assert(wxUSE_STD_CONTAINERS_COMPATIBLY == 1, "interoperability between stl and wxWidgets broken"); -static_assert(wxUSE_STD_CONTAINERS == 1, "wxWidgets api out of date"); +static_assert(wxUSE_STD_CONTAINERS_COMPATIBLY == 1, "wxUSE_STD_CONTAINERS_COMPATIBLY != 1 interoperability between stl and wxWidgets broken"); +static_assert(wxUSE_STD_CONTAINERS == 1, "wxUSE_STD_CONTAINERS != 1 wxWidgets api out of date"); //static_assert(wxUSE_THREADS == 1, "want threads"); -static_assert(wxUSE_STD_STRING_CONV_IN_WXSTRING == 1, "want wxString to conform to std::string"); +static_assert(wxUSE_STD_STRING_CONV_IN_WXSTRING == 1, "wxUSE_STD_STRING_CONV_IN_WXSTRING != 1 want wxString to conform to std::string"); static_assert(wxUSE_SECRETSTORE >0, "need wxSecretStore to actually work"); // The api may be there, but will always return false if wxUSE_SECRETSTORE is zero //static_assert(wxUSE_STD_DEFAULT == 1 && wxUSE_STL==1); diff --git a/wxWidgets b/wxWidgets index 5fd9743..cb9a793 160000 --- a/wxWidgets +++ b/wxWidgets @@ -1 +1 @@ -Subproject commit 5fd97439acaa39c443fe9a852d5806f5cb435a55 +Subproject commit cb9a793248e34926e5928e5254010141620009ea