From 84f3c3e4553c47588c03870007cdbae81de41363 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 15 Apr 2019 13:25:31 +0200 Subject: [PATCH] Add ARM64 compiling support Signed-off-by: Simon Rozman --- .gitignore | 2 ++ Makefile | 7 +++++-- README.md | 4 +++- wintun.vcxproj | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 88cd760..a3e183c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ /x86/Debug /amd64/Release /amd64/Debug +/arm64/Release +/arm64/Debug # Static Driver Verifier Output /sdv diff --git a/Makefile b/Makefile index 428da6f..9577c4a 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,11 @@ PLAT_MSBUILD=Win32 !ELSEIF "$(PLAT)" == "amd64" || "$(PLAT)" == "AMD64" PLAT=amd64 PLAT_MSBUILD=x64 +!ELSEIF "$(PLAT)" == "arm64" || "$(PLAT)" == "ARM64" +PLAT=arm64 +PLAT_MSBUILD=ARM64 !ELSE -!ERROR Invalid platform "$(PLAT)". PLAT must be "x86" or "amd64". +!ERROR Invalid platform "$(PLAT)". PLAT must be "x86", "amd64", or "arm64". !ENDIF OUTPUT_DIR=$(PLAT)\$(CFG) MSBUILD_FLAGS=/p:Configuration="$(CFG)" /p:Platform="$(PLAT_MSBUILD)" /m /v:minimal /nologo @@ -28,7 +31,7 @@ build :: clean :: msbuild.exe "wintun.vcxproj" /t:Clean $(MSBUILD_FLAGS) -!IF "$(CFG)" == "Release" +!IF "$(CFG)" == "Release" && "$(PLAT)" != "arm64" dvl :: "wintun.DVL.XML" diff --git a/README.md b/README.md index a569eb5..401ee15 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ x86 Debug | `x86\Debug\wintun` x86 Release | `x86\Release\wintun` AMD64 Debug | `amd64\Debug\wintun` AMD64 Release | `amd64\Release\wintun` +ARM64 Debug | `arm64\Debug\wintun` +ARM64 Release | `arm64\Release\wintun` ### Properties @@ -62,7 +64,7 @@ Properties may be defined as environment variables, or specified on the `nmake` - `CFG`: Specifies configuration to build or clean. May be `Debug` or `Release` (default). - - `PLAT`: Specifies driver platform to build. May be `x86` or `amd64` (default). + - `PLAT`: Specifies driver platform to build. May be `x86` or `amd64` (default), or `arm64`. ## Usage diff --git a/wintun.vcxproj b/wintun.vcxproj index e5cec0c..320b3fd 100644 --- a/wintun.vcxproj +++ b/wintun.vcxproj @@ -1,6 +1,10 @@  + + Debug + ARM64 + Debug Win32 @@ -9,6 +13,10 @@ Debug x64 + + Release + ARM64 + Release Win32 @@ -49,6 +57,14 @@ WDM false + + Windows10 + false + WindowsKernelModeDriver10.0 + Driver + WDM + false + Windows8 true @@ -57,6 +73,14 @@ WDM false + + Windows10 + true + WindowsKernelModeDriver10.0 + Driver + WDM + false + @@ -69,9 +93,15 @@ + + + + + + 0 0 @@ -100,12 +130,24 @@ amd64\$(ConfigurationName)\ amd64\$(ConfigurationName)\ + + true + $(WDKContentRoot)CodeAnalysis\DriverMustFixRules.ruleset + arm64\$(ConfigurationName)\ + arm64\$(ConfigurationName)\ + true AllRules.ruleset amd64\$(ConfigurationName)\ amd64\$(ConfigurationName)\ + + true + AllRules.ruleset + arm64\$(ConfigurationName)\ + arm64\$(ConfigurationName)\ + WINTUN_VERSION_MAJ=$(WintunVersionMaj);WINTUN_VERSION_MIN=$(WintunVersionMin);WINTUN_VERSION_REV=$(WintunVersionRev);WINTUN_VERSION_BUILD=$(WintunVersionBuild);WINTUN_VERSION_STR="$(WintunVersionStr)";NDIS_MINIPORT_DRIVER=1;NDIS630_MINIPORT=1;NDIS_WDM=1;%(PreprocessorDefinitions) @@ -142,7 +184,9 @@ + +