Add Support for IfcOpenShell on Win ARM64

This commit is contained in:
tsomanna_QCOM
2026-03-09 08:51:30 +05:30
committed by Thomas Krijnen
parent 8bd3fab608
commit b25c24a007
5 changed files with 27462 additions and 26 deletions
+27 -9
View File
@@ -5,11 +5,26 @@ on:
jobs:
build_ifcopenshell:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
arch: ['x64']
include:
- arch: x64
runs_on: windows-2022
deps_dir: _deps-vs2022-x64-installed
vcvars: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"'
arch: x64
zip_suffix: win64
- arch: ARM64
runs_on: windows-11-arm
deps_dir: _deps-vs2022-ARM64-installed
vcvars: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat"'
arch: arm64
zip_suffix: win-arm64
runs-on: ${{ matrix.runs_on }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
@@ -20,7 +35,7 @@ jobs:
uses: actions/checkout@v6
with:
repository: IfcOpenShell/build-outputs
path: _deps-vs2022-x64-installed
path: ${{ matrix.deps_dir }}
ref: windows-${{ matrix.arch }}
lfs: true
token: ${{ secrets.BUILD_REPO_TOKEN }}
@@ -31,7 +46,7 @@ jobs:
- name: Unpack Dependencies
run: |
cd _deps-vs2022-x64-installed
cd ${{ matrix.deps_dir }}
Get-ChildItem -Path . -Filter 'cache-*.zip' | ForEach-Object {
7z x $_.FullName
}
@@ -46,14 +61,16 @@ jobs:
- name: Run Build Script And Pack .zip Archives
shell: cmd
env:
TARGET_ARCH: ${{ matrix.arch }} # lets the Python script know which arch to target (optional override)
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call ${{ matrix.vcvars }}
cd win
python build-all-win.py
- name: Pack Dependencies
run: |
cd _deps-vs2022-x64-installed
cd ${{ matrix.deps_dir }}
Get-ChildItem -Path . -Directory | ForEach-Object {
$cacheFile = "cache-$($_.Name).zip"
echo $cacheFile
@@ -64,12 +81,13 @@ jobs:
- name: Commit and Push Changes to Build Repository
run: |
cd _deps-vs2022-x64-installed
cd ${{ matrix.deps_dir }}
git config user.name "IfcOpenBot"
git config user.email "ifcopenbot@ifcopenshell.org"
git checkout -B ${{ matrix.build_branch }}
git add *.zip
git commit -m "Update build artifacts [skip ci]" || echo "No changes to commit"
git push || echo "Push failed"
git commit -m "Update ARM64 build caches [skip ci]" || echo "No changes to commit"
git push --set-upstream origin ${{ matrix.build_branch }} || echo "Push failed"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6
+17 -4
View File
@@ -9,6 +9,15 @@ import subprocess
import zipfile
from pathlib import Path
from zipfile import ZipFile
import platform
def is_arm64() -> bool:
arch = os.environ.get("TARGET_ARCH", "").lower()
if arch in ("arm64", "aarch64"):
return True
if arch in ("x64", "amd64", "x86_64"):
return False
return platform.machine().lower() in ("arm64", "aarch64")
assert Path.cwd() == Path(__file__).parent, "Run this script from the 'win' directory."
@@ -23,7 +32,7 @@ else:
OUTPUT_DIR = Path.home() / "output"
OUTPUT_DIR.mkdir(exist_ok=True)
print("Output directory:", OUTPUT_DIR)
ZIP_TEMPLATE = f"{{package_name}}-v{VERSION}-{SHA}-win64.zip"
ZIP_TEMPLATE = f"{{package_name}}-v{VERSION}-{SHA}-{'win-arm64' if is_arm64() else 'win64'}.zip"
def run(command: list[str]) -> None:
@@ -52,7 +61,11 @@ def build() -> None:
os.environ["PYTHON_VERSION"] = python_version
print(f"Building for Python {python_version}...")
subprocess.run(
[str(REPO_WIN / "build-deps.cmd"), "vs2022-x64", "Release"],
[
str(REPO_WIN / "build-deps.cmd"),
"vs2022-ARM64" if is_arm64() else "vs2022-x64",
"Release",
],
check=True,
text=True,
input="y\n",
@@ -61,13 +74,13 @@ def build() -> None:
run(
[
str(REPO_WIN / "run-cmake.bat"),
"vs2022-x64",
"vs2022-ARM64" if is_arm64() else "vs2022-x64",
"-DENABLE_BUILD_OPTIMIZATIONS=ON",
"-DGLTF_SUPPORT=ON",
]
)
restore_env(*OLD_ADD_COMMIT_SHA)
run([str(REPO_WIN / "install-ifcopenshell.bat"), "vs2022-x64", "Release"])
run([str(REPO_WIN / "install-ifcopenshell.bat"), "vs2022-ARM64" if is_arm64() else "vs2022-x64", "Release"])
def archive_executables() -> None:
+41 -9
View File
@@ -132,7 +132,7 @@ call cecho.cmd 0 10 "Script configuration:"
call cecho.cmd 0 13 "* CMake Generator`t= '`"%GENERATOR%`'`t
echo - Passed to CMake -G option.
call cecho.cmd 0 13 "* Target Architecture`t= %TARGET_ARCH%"
echo - Whether were doing 32-bit (x86) or 64-bit (x64) build.
echo - Whether were doing 32-bit (x86) or 64-bit (x64, arm64) build.
call cecho.cmd 0 13 "* Target Platform`t= %VS_PLATFORM%"
echo - Passed to CMake -A option.
call cecho.cmd 0 13 "* Target Toolset`t= %VS_TOOLSET%"
@@ -187,9 +187,16 @@ IF DEFINED PYTHON_VERSION (
)
:: VERSION DERIVATIONS
for /f "tokens=1,2,3 delims=." %%a in ("%PYTHON_VERSION%") do (
set PY_VER_MAJOR_MINOR=%%a%%b
)
IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
IF /I "%TARGET_ARCH%"=="arm64" (
set PYTHONHOME=%DEPS_DIR%\pythonarm64.%PYTHON_VERSION%\tools
) ELSE (
set PYTHONHOME=%DEPS_DIR%\python.%PYTHON_VERSION%\tools
)
)
:: Cache last used CMake generator and configurable dependency dirs for other scripts to use
:: This is consolidated at the beginning of the script so that the script can be partially
@@ -312,6 +319,11 @@ powershell -c "get-content %~dp0patches\mpir.patch | %%{$_ -replace \"sdk\",\"%U
IF NOT %ERRORLEVEL%==0 GOTO :Error
if NOT "%USE_STATIC_RUNTIME%"=="FALSE" git apply "%~dp0patches\mpir_runtime.patch" --unidiff-zero --ignore-whitespace
IF NOT %ERRORLEVEL%==0 GOTO :Error
IF /I "%VS_PLATFORM%"=="ARM64" (
echo "Applying ARM64 Patches for Mpir"
git apply "%~dp0patches\mpir-arm64-changes.patch" --unidiff-zero --ignore-whitespace
)
IF NOT %ERRORLEVEL%==0 GOTO :Error
cd msvc
cd vs%VS_VER:~2,2%
call .\msbuild.bat gc LIB %VS_PLATFORM% %DEBUG_OR_RELEASE%
@@ -338,6 +350,10 @@ powershell -c "get-content %~dp0patches\mpfr.patch | %%{$_ -replace \"sdk\",\"%U
IF NOT %ERRORLEVEL%==0 GOTO :Error
if NOT "%USE_STATIC_RUNTIME%"=="FALSE" git apply "%~dp0patches\mpfr_runtime.patch" --unidiff-zero --ignore-whitespace
IF NOT %ERRORLEVEL%==0 GOTO :Error
IF /I "%VS_PLATFORM%"=="ARM64" (
echo "Applying ARM64 Patches for Mpfr"
git apply "%~dp0patches\mpfr-arm64-changes.patch" --unidiff-zero --ignore-whitespace
)
if "%VS_VER%"=="2017" (
set mpfr_sln=build.vc15
set orig_platform_toolset=v141
@@ -406,6 +422,7 @@ cd "%DEPS_DIR%"
call :DownloadFile https://github.com/boostorg/boost/releases/download/boost-%BOOST_VERSION%/%BOOST_ZIP% "%DEPS_DIR%" %BOOST_ZIP%
IF NOT %ERRORLEVEL%==0 GOTO :Error
cd "%DEPS_DIR%"
call :ExtractArchive %BOOST_ZIP% "%DEPS_DIR%" %DEPENDENCY_DIR%
IF NOT %ERRORLEVEL%==0 GOTO :Error
@@ -429,13 +446,22 @@ if not exist "%DEPENDENCY_DIR%\project-config.jam". (
IF NOT %ERRORLEVEL%==0 GOTO :Error
)
if /I "%TARGET_ARCH%"=="x64" (
set B2_ARCH_FEATURE=x86
) else if /I "%TARGET_ARCH%"=="arm64" (
set B2_ARCH_FEATURE=arm
) else (
echo "Failed to identify architecture"
GOTO :Error
)
set BOOST_LIBS=--with-system --with-regex --with-thread --with-program_options --with-date_time --with-iostreams --with-filesystem
:: NOTE Boost is fast to build with limited set of libraries so build it always.
cd "%DEPENDENCY_DIR%"
call cecho.cmd 0 13 "Building %DEPENDENCY_NAME% %BOOST_LIBS% Please be patient, this will take a while."
IF EXIST "%DEPENDENCY_DIR%\bin.v2\project-cache.jam" del "%DEPENDENCY_DIR%\bin.v2\project-cache.jam"
call .\b2 toolset=%BOOST_TOOLSET% runtime-link=shared address-model=%ARCH_BITS% --abbreviate-paths -j%IFCOS_NUM_BUILD_PROCS% ^
call .\b2 toolset=%BOOST_TOOLSET% architecture=%B2_ARCH_FEATURE% runtime-link=shared address-model=%ARCH_BITS% --abbreviate-paths -j%IFCOS_NUM_BUILD_PROCS% ^
variant=%DEBUG_OR_RELEASE_LOWERCASE% %BOOST_WIN_API% %BOOST_LIBS% stage --stagedir=%DEPENDENCY_INSTALL_DIR%
IF NOT %ERRORLEVEL%==0 GOTO :Error
@@ -561,9 +587,10 @@ SET COMPILE_WITH_WPO=FALSE
:Python
set DEPENDENCY_NAME=Python %PYTHON_VERSION%
set DEPENDENCY_DIR=N/A
set PYTHON_AMD64_POSTFIX=-amd64
IF NOT %TARGET_ARCH%==x64 set PYTHON_AMD64_POSTFIX=
set PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.exe
set PYTHON_AMD64_POSTFIX=
IF /I "%TARGET_ARCH%"=="x64" set "PYTHON_AMD64_POSTFIX=-amd64"
IF /I "%TARGET_ARCH%"=="arm64" set "PYTHON_AMD64_POSTFIX=-arm64"
set "PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.exe"
IF NOT "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
call cecho.cmd 0 13 "IFCOS_INSTALL_PYTHON not 'TRUE', skipping installation of Python."
@@ -571,22 +598,25 @@ IF NOT "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
)
:: nuget doesn't support providing architecture for packages.
if NOT %TARGET_ARCH%==x64 (
IF /I NOT "%TARGET_ARCH%"=="x64" IF /I NOT "%TARGET_ARCH%"=="arm64" (
call cecho.cmd 0 12 "Automatic insallation of Python for x86 builds is not supported,"
call cecho.cmd 0 12 "please install Python %PYTHON_VERSION% manually and ensure that it is available in PATH."
call cecho.cmd 0 12 "https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER%"
goto :Error
)
if EXIST "%PYTHONHOME%" (
echo Found existing '%PYTHONHOME%', skipping installation.
goto :SWIG
)
IF /I "%TARGET_ARCH%"=="x64" (
"%NUGET_EXE%" install Python -Version %PYTHON_VERSION% -OutputDirectory "%DEPS_DIR%"
IF NOT %ERRORLEVEL%==0 GOTO :Error
) ELSE (
"%NUGET_EXE%" install pythonarm64 -Version %PYTHON_VERSION% -OutputDirectory "%DEPS_DIR%"
IF NOT %ERRORLEVEL%==0 GOTO :Error
)
:SWIG
set DEPENDENCY_NAME=SWIG
@@ -723,6 +753,9 @@ call :RunCMake -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%\%DEPENDENCY_INSTALL_NAME%"
-DWITH_CORE_TOOLS=OFF ^
-DROCKSDB_BUILD_SHARED=OFF ^
-DWITH_ZSTD=On ^
-DZSTD_INCLUDE_DIR="%ZSTD_INCLUDE%" ^
-DZSTD_LIBRARY_DEBUG="%ZSTD_LIB_DEBUG%" ^
-DZSTD_LIBRARY_RELEASE="%ZSTD_LIB_RELEASE%" ^
-DPORTABLE=1 ^
-DCMAKE_DEBUG_POSTFIX="_d"
IF NOT %ERRORLEVEL%==0 GOTO :Error
@@ -960,4 +993,3 @@ echo - https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx
echo.
echo NB: This script needs to be ran from the directory directly containing it.
echo.
File diff suppressed because it is too large Load Diff
+519
View File
@@ -0,0 +1,519 @@
diff --git a/msvc/postbuild.bat b/msvc/postbuild.bat
index 1c301d1a..7d5362be 100644
--- a/msvc/postbuild.bat
+++ b/msvc/postbuild.bat
@@ -1,6 +1,6 @@
@echo off
rem %1 = full target path
-rem %2 = last two digits of the Visual Studio version number (e.g. 17)
+rem %2 = last two digits of the Visual Studio version number (e.g. 17 or 22)
set vs_ver=%2
set str=%~1
@@ -20,11 +20,13 @@ goto dele
set str=%str_confirmed%
echo "Final subpath %str%"
-rem we now have: msvc.\vs<nn>\<project_directory>\<win32|x64>\<debug|release>\mpir.<lib|dll>
-rem extract: project_directory, platform (plat=<win32|x64>), configuration (conf=<debug|release>) and file name
+rem we now have: msvc\vs<nn>\<project>\<plat>\<conf>\mpir(.xx).<lib|dll>
+rem extract: project_directory, platform (plat), configuration (conf) and file name
set file=
-for /f "tokens=1,2,3,4,5,6 delims=\" %%a in ("%str%") do set tloc=%%c&set plat=%%d&set conf=%%e&set file=%%f
+for /f "tokens=1,2,3,4,5,6 delims=\" %%a in ("%str%") do (
+ set tloc=%%c&set plat=%%d&set conf=%%e&set file=%%f
+)
if /i "%file%" NEQ "" (goto next)
call :seterr & echo ERROR: %1 is not supported & exit /b %errorlevel%
@@ -42,9 +44,9 @@ call :seterr & echo "postbuild copy error ERROR: target=%tloc%, plat=%plat%, con
:is2nd:
rem set the target and final binary output directories
-set tgt_dir="vs%vs_ver%\%loc%%plat%\%conf%\"
-set bin_dir="..\%extn%\%plat%\%conf%\"
-set hdr_dir="..\%extn%\%plat%\%conf%\"
+set "tgt_dir=vs%vs_ver%\%loc%%plat%\%conf%"
+set "bin_dir=..\%extn%\%plat%\%conf%"
+set "hdr_dir=..\%extn%\%plat%\%conf%"
rem output parametrers for the MPIR tests
if /i "%filename%" EQU "mpirxx" goto skip
@@ -66,43 +68,42 @@ rem %1 = target (build output) directory
rem %2 = binary destination directory
rem %3 = configuration (debug/release)
rem %4 = library (lib/dll)
-rem %5 = file name
+rem %5 = file name (mpir | mpirxx)
:copyb
if "%4" EQU "dll" (
- copy %1mpir.dll %2mpir.dll > nul 2>&1
- copy %1mpir.exp %2mpir.exp > nul 2>&1
- copy %1mpir.lib %2mpir.lib > nul 2>&1
- if exist %1mpir.pdb (copy %1mpir.pdb %2mpir.pdb > nul 2>&1)
+ copy "%~1\mpir.dll" "%~2\mpir.dll" > nul 2>&1
+ copy "%~1\mpir.exp" "%~2\mpir.exp" > nul 2>&1
+ copy "%~1\mpir.lib" "%~2\mpir.lib" > nul 2>&1
+ if exist "%~1\mpir.pdb" copy "%~1\mpir.pdb" "%~2\mpir.pdb" > nul 2>&1
) else if "%4" EQU "lib" (
if "%5" EQU "mpir" (
- if exist %1mpir.lib (
- copy %1mpir.lib %2mpir.lib > nul 2>&1
- if exist %1mpir.pdb (copy %1mpir.pdb %2mpir.pdb > nul 2>&1)
+ if exist "%~1\mpir.lib" (
+ copy "%~1\mpir.lib" "%~2\mpir.lib" > nul 2>&1
+ if exist "%~1\mpir.pdb" copy "%~1\mpir.pdb" "%~2\mpir.pdb" > nul 2>&1
+ ) else (
+ echo "Not Found MPIR at location" "%~1\mpir.lib"
)
) else if "%5" EQU "mpirxx" (
- if exist %1mpirxx.lib (
- copy %1mpirxx.lib %2mpirxx.lib > nul 2>&1
- if exist %1mpirxx.pdb (copy %1mpirxx.pdb %2mpirxx.pdb > nul 2>&1)
+ if exist "%~1\mpirxx.lib" (
+ copy "%~1\mpirxx.lib" "%~2\mpirxx.lib" > nul 2>&1
+ if exist "%~1\mpirxx.pdb" copy "%~1\mpirxx.pdb" "%~2\mpirxx.pdb" > nul 2>&1
)
)
) else (
- call :seterr & echo ERROR: illegal library type %4 & exit /b %errorlevel%
+ call :seterr & echo ERROR: illegal library type %4 & exit /b %errorlevel%
)
-
-rem set configuration for the tests
-call gen_test_config_props %plat% %conf% %vs_ver%
exit /b 0
rem copy headers to final destination directory
:copyh
-copy ..\config.h %1config.h > nul 2>&1
-copy ..\gmp-mparam.h %1gmp-mparam.h > nul 2>&1
-copy ..\mpir.h %1mpir.h > nul 2>&1
-copy ..\mpir.h %1gmp.h > nul 2>&1
-copy ..\gmp-impl.h %1gmp-impl.h > nul 2>&1
-copy ..\longlong.h %1longlong.h > nul 2>&1
-copy ..\mpirxx.h %1mpirxx.h > nul 2>&1
-copy ..\mpirxx.h %1gmpxx.h > nul 2>&1
+copy "..\config.h" "%~1\config.h" > nul 2>&1
+copy "..\gmp-mparam.h" "%~1\gmp-mparam.h" > nul 2>&1
+copy "..\mpir.h" "%~1\mpir.h" > nul 2>&1
+copy "..\mpir.h" "%~1\gmp.h" > nul 2>&1
+copy "..\gmp-impl.h" "%~1\gmp-impl.h" > nul 2>&1
+copy "..\longlong.h" "%~1\longlong.h" > nul 2>&1
+copy "..\mpirxx.h" "%~1\mpirxx.h" > nul 2>&1
+copy "..\mpirxx.h" "%~1\gmpxx.h" > nul 2>&1
exit /b 0
:seterr
diff --git a/msvc/prebuild.bat b/msvc/prebuild.bat
index 243d054f..c1d49c67 100644
--- a/msvc/prebuild.bat
+++ b/msvc/prebuild.bat
@@ -1,29 +1,56 @@
@echo off
-rem %1 = mpn directory (generic, x86\... or x86_64\...)
-rem %2 = platform (win32 or x64)
+rem %1 = mpn directory (generic, x86\... or x86_64\... or arm64\...)
+rem %2 = platform (win32, x64/amd64, or arm64)
rem %3 = MSVC version number (e.g. 14)
-if /i "%2" EQU "win32" ((set platform=win32) & (set bdir=x86w\)) else ((set platform=x64) & (set bdir=x86_64w\))
-set sdir=
-if /i "%1" EQU "gc" ((set sdir=generic) & (set bdir=generic)) else (set sdir=%bdir%%1)
-if not exist ..\mpn\%sdir% (call :seterr & echo ERROR: %1 is not supported & exit /b %errorlevel%)
+set "platform="
+set "bdir="
+
+if /i "%2"=="win32" (
+ set "platform=win32"
+ set "bdir=x86w\"
+) else if /i "%2"=="x64" (
+ set "platform=x64"
+ set "bdir=x86_64w\"
+) else if /i "%2"=="arm64" (
+ set "platform=arm64"
+ set "bdir=arm64w\"
+) else (
+ call :seterr & echo ERROR: Unsupported platform "%2" (expected win32, x64/amd64, or arm64) & exit /b %errorlevel%
+)
+
+set "sdir="
+if /i "%1"=="gc" (
+ rem Generic C (portable) implementation
+ set "sdir=generic"
+ set "bdir=generic"
+) else (
+ set "sdir=%bdir%%~1"
+)
+
+if not exist "..\mpn\%sdir%" (
+ call :seterr & echo ERROR: %1 is not supported & exit /b %errorlevel%
+)
echo building MPIR for %1 (%platform%) from directory mpn\%sdir%
-set cdir=vs%3\cdata\mpn\%sdir%\
-set sdir=..\mpn\%sdir%\
-set bdir=..\mpn\%bdir%\
+set "cdir=vs%3\cdata\mpn\%sdir%\"
+set "sdir=..\mpn\%sdir%\"
+set "bdir=..\mpn\%bdir%\"
call gen_mpir_h %platform%
call gen_config_h %cdir%
-if exist %sdir%\gmp-mparam.h (call out_copy_rename %sdir%\gmp-mparam.h ..\ gmp-mparam.h) else (
- call out_copy_rename %bdir%\gmp-mparam.h ..\ gmp-mparam.h)
+if exist "%sdir%\gmp-mparam.h" (
+ call out_copy_rename "%sdir%\gmp-mparam.h" "..\" "gmp-mparam.h"
+) else (
+ call out_copy_rename "%bdir%\gmp-mparam.h" "..\" "gmp-mparam.h"
+)
-type ..\longlong_pre.h >tmp.h
-type %bdir%\longlong_inc.h >>tmp.h
-type ..\longlong_post.h >>tmp.h
-call out_copy_rename tmp.h ..\ longlong.h
+type "..\longlong_pre.h" > tmp.h
+type "%bdir%\longlong_inc.h" >> tmp.h
+type "..\longlong_post.h" >> tmp.h
+call out_copy_rename tmp.h "..\" "longlong.h"
del tmp.h
exit /b 0
diff --git a/msvc/vs22/lib_mpir_cxx/lib_mpir_cxx.vcxproj b/msvc/vs22/lib_mpir_cxx/lib_mpir_cxx.vcxproj
index 0aca0c6e..e4bcf619 100644
--- a/msvc/vs22/lib_mpir_cxx/lib_mpir_cxx.vcxproj
+++ b/msvc/vs22/lib_mpir_cxx/lib_mpir_cxx.vcxproj
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="19.30.30401" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -40,11 +48,21 @@
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
@@ -58,17 +76,27 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
<Import Project="..\..\mpir_release_lib.props" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ <Import Project="..\..\mpir_release_lib.props" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
<Import Project="..\..\mpir_debug_lib.props" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ <Import Project="..\..\mpir_debug_lib.props" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mpirxx</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mpirxx</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mpirxx</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">mpirxx</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mpirxx</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">mpirxx</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -99,6 +127,17 @@ postbuild "$(TargetPath)" 22
</ClCompile>
<PostBuildEvent>
<Command>cd ..\..\
+postbuild "$(TargetPath)" 22
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>cd ..\..\
postbuild "$(TargetPath)" 22
</Command>
</PostBuildEvent>
@@ -110,6 +149,17 @@ postbuild "$(TargetPath)" 22
</ClCompile>
<PostBuildEvent>
<Command>cd ..\..\
+postbuild "$(TargetPath)" 22
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>cd ..\..\
postbuild "$(TargetPath)" 22
</Command>
</PostBuildEvent>
@@ -141,7 +191,7 @@ postbuild "$(TargetPath)" 22
<ItemGroup>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-<ItemGroup>
+ <ItemGroup>
<None Include="..\..\..\gmp-h.in" />
- </ItemGroup>
-</Project>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/msvc/vs22/lib_mpir_gc/lib_mpir_gc.vcxproj b/msvc/vs22/lib_mpir_gc/lib_mpir_gc.vcxproj
index 350ee110..faf49ac3 100644
--- a/msvc/vs22/lib_mpir_gc/lib_mpir_gc.vcxproj
+++ b/msvc/vs22/lib_mpir_gc/lib_mpir_gc.vcxproj
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="19.30.30401" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|ARM64">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -40,11 +48,21 @@
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
@@ -58,23 +76,32 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
<Import Project="..\..\mpir_release_lib.props" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ <Import Project="..\..\mpir_release_lib.props" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
<Import Project="..\..\mpir_debug_lib.props" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ <Import Project="..\..\mpir_debug_lib.props" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.21006.1</_ProjectFileVersion>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mpir</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mpir</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mpir</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">mpir</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mpir</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">mpir</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>cd ..\..\
-prebuild gc Win32 22
- </Command>
+prebuild gc $(Platform) 22</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
@@ -82,15 +109,13 @@ prebuild gc Win32 22
</ClCompile>
<PostBuildEvent>
<Command>cd ..\..\
-postbuild "$(TargetPath)" 22
- </Command>
+postbuild "$(TargetPath)" 22</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>cd ..\..\
-prebuild gc Win32 22
- </Command>
+prebuild gc $(Platform) 22</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
@@ -98,15 +123,27 @@ prebuild gc Win32 22
</ClCompile>
<PostBuildEvent>
<Command>cd ..\..\
-postbuild "$(TargetPath)" 22
- </Command>
+postbuild "$(TargetPath)" 22</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command>cd ..\..\
-prebuild gc x64 22
- </Command>
+prebuild gc $(Platform) 22</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;WIN32;_LIB;HAVE_CONFIG_H;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>cd ..\..\
+postbuild "$(TargetPath)" 22</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <PreBuildEvent>
+ <Command>cd ..\..\
+prebuild gc $(Platform) 22</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
@@ -114,15 +151,13 @@ prebuild gc x64 22
</ClCompile>
<PostBuildEvent>
<Command>cd ..\..\
-postbuild "$(TargetPath)" 22
- </Command>
+postbuild "$(TargetPath)" 22</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
<Command>cd ..\..\
-prebuild gc x64 22
- </Command>
+prebuild gc $(Platform) 22</Command>
</PreBuildEvent>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
@@ -130,8 +165,21 @@ prebuild gc x64 22
</ClCompile>
<PostBuildEvent>
<Command>cd ..\..\
-postbuild "$(TargetPath)" 22
- </Command>
+postbuild "$(TargetPath)" 22</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
+ <PreBuildEvent>
+ <Command>cd ..\..\
+prebuild gc $(Platform) 22</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <AdditionalIncludeDirectories>..\..\..\</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;WIN32;_LIB;HAVE_CONFIG_H;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>cd ..\..\
+postbuild "$(TargetPath)" 22</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ImportGroup>
@@ -667,7 +715,7 @@ postbuild "$(TargetPath)" 22
<ItemGroup>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-<ItemGroup>
+ <ItemGroup>
<None Include="..\..\..\gmp-h.in" />
- </ItemGroup>
-</Project>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/msvc/vs22/msbuild.bat b/msvc/vs22/msbuild.bat
index f119c3e9..36bfe28b 100644
--- a/msvc/vs22/msbuild.bat
+++ b/msvc/vs22/msbuild.bat
@@ -1,7 +1,7 @@
@echo off
rem %1 = architecture
rem %2 = library type (LIB|DLL)
-rem %3 = platform (Win32|x64)
+rem %3 = platform (Win32|x64|ARM64)
rem %4 = configuration (Release|Debug)
rem %5 = Windows SDK Version
rem %6 = build tests (|+tests)
@@ -31,15 +31,21 @@ if not exist !msb_exe! (
if "%4" NEQ "" if "%3" NEQ "" if "%2" NEQ "" if "%1" NEQ "" goto cont
call :get_architectures -
-echo usage: msbuild architecture=^<%architectures:|=^|%^> library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^> [Windows_SDK_Version=^<n^>] [+tests]
+echo usage: msbuild architecture=^<%architectures:|=^|%^> library_type=^<LIB^|DLL^> platform=^<Win32^|x64^|ARM64^> configuration=^<Release^|Debug^> [Windows_SDK_Version=^<n^>] [+tests]
goto :eof
:cont
rem example use: msbuild sandybridge_ivybridge dll x64 release
if not exist "lib_mpir_%1" (call :get_architectures & call :seterr & echo ERROR: architecture is one of ^(%architectures%^) ^(not %1^) & exit /b %errorlevel%)
if /i "%2" EQU "DLL" (set libp=dll) else (if /i "%2" EQU "LIB" (set libp=lib) else ((call :seterr & echo ERROR: library type is "lib" or "dll" ^(not "%2"^) & exit /b %errorlevel%)))
-if /i "%3" EQU "x64" (set plat=x64) else (if /i "%3" EQU "Win32" (set plat=win32) else (call :seterr & echo ERROR: platform is "Win32" or "x64" ^(not "%3"^) & exit /b %errorlevel%))
-if /i "%4" EQU "Debug" (set conf=Debug) else (if /i "%4" EQU "Release" (set conf=Release) else (call :seterr & echo ERROR: configuration is "Release" or "Debug" ^(not "%4"^) & exit /b %errorlevel%))
+if /i "%3" EQU "x64" (set plat=x64) else (
+ if /i "%3" EQU "Win32" (set plat=win32) else (
+ if /i "%3" EQU "ARM64" (set plat=ARM64) else (
+ call :seterr & echo ERROR: platform is "Win32", "x64", or "ARM64" ^(not %3^) & exit /b %errorlevel%
+ )
+ )
+)
+if /i "%4" EQU "Debug" (set conf=Debug) else (if /i "%4" EQU "Release" (set conf=Release) else (call :seterr & echo ERROR: configuration is "Release" or "Debug" ^(not %4^) & exit /b %errorlevel%))
if /i "%5" NEQ "" if "%5" EQU "+tests" (set run_tests=y) else (set win_sdk=%5)
if /i "%6" NEQ "" if "%6" EQU "+tests" (set run_tests=y)