From 746c8d625058580735a02fc8f368f03d0dea58b0 Mon Sep 17 00:00:00 2001 From: Hal Wine Date: Sun, 13 Aug 2023 12:02:14 -0700 Subject: [PATCH 1/2] Add scripts for arm64 building Also, ignore build_arm64 output --- .gitignore | 1 + tools/arm64-build-win-vind.bat | 8 ++++++++ tools/arm64-build-wxwidgets.bat | 20 ++++++++++++++++++++ tools/arm64-clean-checkout-wxwidgets.bat | 16 ++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 tools/arm64-build-win-vind.bat create mode 100644 tools/arm64-build-wxwidgets.bat create mode 100644 tools/arm64-clean-checkout-wxwidgets.bat diff --git a/.gitignore b/.gitignore index a0006af1..6b132f9a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ bin bin_32 bin_64 build +build_arm64 build_cov choco cmake_modules diff --git a/tools/arm64-build-win-vind.bat b/tools/arm64-build-win-vind.bat new file mode 100644 index 00000000..3391ec3a --- /dev/null +++ b/tools/arm64-build-win-vind.bat @@ -0,0 +1,8 @@ +@REM from https://github.com/pit-ray/win-vind/issues/191#issuecomment-1671656805 + +call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" +if %errorlevel% neq 0 exit /b %errorlevel% +cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release -DwxWidgets_LIB_DIR=libs/wxWidgets/lib/vc_arm64_lib -G "Visual Studio 16 2019" -A Arm64 . +if %errorlevel% neq 0 exit /b %errorlevel% +cmake --build build_arm64 --config Release +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/tools/arm64-build-wxwidgets.bat b/tools/arm64-build-wxwidgets.bat new file mode 100644 index 00000000..2ec385f8 --- /dev/null +++ b/tools/arm64-build-wxwidgets.bat @@ -0,0 +1,20 @@ +# taken from https://github.com/pit-ray/win-vind/issues/191#issuecomment-1671656805 + +# Assume wxwidgets source already available. For fresh copy use +# .\tools\arm65-clean-checkout-wxwidgets.bat + +cd libs +if %errorlevel% neq 0 exit /b %errorlevel% + +cd wxWidgets +if %errorlevel% neq 0 exit /b %errorlevel% +cd build/msw +if %errorlevel% neq 0 exit /b %errorlevel% +rem call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" +rem if %errorlevel% neq 0 exit /b %errorlevel% +call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" +if %errorlevel% neq 0 exit /b %errorlevel% +nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=1 TARGET_CPU=ARM64 RUNTIME_LIBS=static +if %errorlevel% neq 0 exit /b %errorlevel% +cd ../../../ +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/tools/arm64-clean-checkout-wxwidgets.bat b/tools/arm64-clean-checkout-wxwidgets.bat new file mode 100644 index 00000000..598a7fc9 --- /dev/null +++ b/tools/arm64-clean-checkout-wxwidgets.bat @@ -0,0 +1,16 @@ +# clean the wxWidgets + +cd libs +if %errorlevel% neq 0 exit /b %errorlevel% + +rmdir /s wxWidgets +if %errorlevel% neq 0 exit /b %errorlevel% + +# get fresh copies +git clone https://github.com/wxWidgets/wxWidgets.git -b v3.1.5 -j %NUMBER_OF_PROCESSORS% --depth=1 +if %errorlevel% neq 0 exit /b %errorlevel% + +cd wxWidgets +if %errorlevel% neq 0 exit /b %errorlevel% +git submodule update --init -j %NUMBER_OF_PROCESSORS% +if %errorlevel% neq 0 exit /b %errorlevel% From 186611988d3d63591c9730324569ba8e5eae2297 Mon Sep 17 00:00:00 2001 From: Hal Wine Date: Tue, 15 Aug 2023 12:02:55 -0700 Subject: [PATCH 2/2] Progress on build Tweaked a few things, and down to one linker error concerning a missing wxmsw31u_html.lib --- src/CMakeLists.txt | 2 ++ tools/arm64-build-win-vind.bat | 2 +- tools/arm64-build-wxwidgets.bat | 11 +++++++---- tools/arm64-clean-checkout-wxwidgets.bat | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91adc204..57388a02 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,6 +18,8 @@ if(NOT wxWidgets_LIB_DIR) if(${MSVC}) if(${GEN_ARCH} STREQUAL "x64") set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/lib/vc_x64_lib) + elseif(${GEN_ARCH} STREQUAL "arm64") + set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/lib/vc_arm64_lib) else() set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/lib/vc_lib) endif() diff --git a/tools/arm64-build-win-vind.bat b/tools/arm64-build-win-vind.bat index 3391ec3a..030d29de 100644 --- a/tools/arm64-build-win-vind.bat +++ b/tools/arm64-build-win-vind.bat @@ -4,5 +4,5 @@ call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Too if %errorlevel% neq 0 exit /b %errorlevel% cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release -DwxWidgets_LIB_DIR=libs/wxWidgets/lib/vc_arm64_lib -G "Visual Studio 16 2019" -A Arm64 . if %errorlevel% neq 0 exit /b %errorlevel% -cmake --build build_arm64 --config Release +cmake --build build_arm64 -DwxWidgets_LIBRARIES=libs/wxWidgets/lib/vc_arm64_lib --config Release if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/tools/arm64-build-wxwidgets.bat b/tools/arm64-build-wxwidgets.bat index 2ec385f8..a52efb95 100644 --- a/tools/arm64-build-wxwidgets.bat +++ b/tools/arm64-build-wxwidgets.bat @@ -1,7 +1,7 @@ -# taken from https://github.com/pit-ray/win-vind/issues/191#issuecomment-1671656805 +@REM taken from https://github.com/pit-ray/win-vind/issues/191#issuecomment-1671656805 -# Assume wxwidgets source already available. For fresh copy use -# .\tools\arm65-clean-checkout-wxwidgets.bat +@REM Assume wxwidgets source already available. For fresh copy use +@REM .\tools\arm65-clean-checkout-wxwidgets.bat cd libs if %errorlevel% neq 0 exit /b %errorlevel% @@ -14,7 +14,10 @@ rem call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxil rem if %errorlevel% neq 0 exit /b %errorlevel% call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat" if %errorlevel% neq 0 exit /b %errorlevel% -nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=1 TARGET_CPU=ARM64 RUNTIME_LIBS=static + +@REM nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=1 TARGET_CPU=ARM64 RUNTIME_LIBS=static +@REM from https://www.andregarzia.com/2019/12/wxwidgets-works-under-windows-on-arm.html try without unicode +nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=0 TARGET_CPU=ARM64 RUNTIME_LIBS=static if %errorlevel% neq 0 exit /b %errorlevel% cd ../../../ if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/tools/arm64-clean-checkout-wxwidgets.bat b/tools/arm64-clean-checkout-wxwidgets.bat index 598a7fc9..0d3602e9 100644 --- a/tools/arm64-clean-checkout-wxwidgets.bat +++ b/tools/arm64-clean-checkout-wxwidgets.bat @@ -1,4 +1,4 @@ -# clean the wxWidgets +@REM clean the wxWidgets cd libs if %errorlevel% neq 0 exit /b %errorlevel% @@ -6,7 +6,7 @@ if %errorlevel% neq 0 exit /b %errorlevel% rmdir /s wxWidgets if %errorlevel% neq 0 exit /b %errorlevel% -# get fresh copies +@REM get fresh copies git clone https://github.com/wxWidgets/wxWidgets.git -b v3.1.5 -j %NUMBER_OF_PROCESSORS% --depth=1 if %errorlevel% neq 0 exit /b %errorlevel%