building wxWidgets as a cmake project file instead of visual studio project file

This commit is contained in:
Cheng 2024-02-22 12:44:30 +00:00
parent f999a8280d
commit 21cc95e246
No known key found for this signature in database
GPG Key ID: 571C3A9C3B9E6FCA
5 changed files with 136 additions and 29 deletions

55
msvc/wx_cmake_Debug.bat Normal file
View File

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

57
msvc/wx_cmake_Release.bat Normal file
View File

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

View File

@ -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 (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" 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 echo on
cd wxWidgets\build\msw 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 msbuild wx_vc17.sln -m -p:Configuration=Debug;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
PAUSE PAUSE
GOTO:EOF GOTO:EOF
) )
echo on echo on
cd ..\..\.. cd ..\..\..
msbuild wallet.sln -p:Configuration=Debug;Platform=x64 -m msbuild msvc/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
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
PAUSE PAUSE
@ -38,12 +40,5 @@ echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
echo failed unit test on debug build echo failed unit test on debug build
) ELSE ( ) ELSE (
echo passed unit test on debug build) 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
) )

View File

@ -66,10 +66,10 @@ R"(In fully utf environment, (wallet.manifest plus
static_assert(wxUSE_IPV6 == 1, "IP6 unavailable in wxWidgets"); static_assert(wxUSE_IPV6 == 1, "IP6 unavailable in wxWidgets");
static_assert(WXWIN_COMPATIBILITY_3_0 == 0, "wxWidgets api out of date"); 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_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_COMPATIBLY == 1, "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 == 1, "wxUSE_STD_CONTAINERS != 1 wxWidgets api out of date");
//static_assert(wxUSE_THREADS == 1, "want threads"); //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"); 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 // The api may be there, but will always return false if wxUSE_SECRETSTORE is zero
//static_assert(wxUSE_STD_DEFAULT == 1 && wxUSE_STL==1); //static_assert(wxUSE_STD_DEFAULT == 1 && wxUSE_STL==1);

@ -1 +1 @@
Subproject commit 5fd97439acaa39c443fe9a852d5806f5cb435a55 Subproject commit cb9a793248e34926e5928e5254010141620009ea