Skip to content

Commit c8463df

Browse files
committed
cmake: attempt to work around the problem with VS 2019 ARM64 builds.
1 parent 2ec8cb0 commit c8463df

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.appveyor.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ environment:
2626
#
2727
# For now, we disable the remote capture build there.
2828
#
29+
# To work around a rpoblem that has popped up in some places, wherein
30+
# building for ARM64 gives a warning that _CountOneBits64 isn't
31+
# defined, force the VS 2019 ARM64 builds to use the 10.0.22621.0
32+
# SDK. This problem was happening to us, and some others online
33+
# reported it, including
34+
#
35+
# https://zhuanlan.zhihu.com/p/1935500669210572158
36+
#
37+
# which, after translation by Google Translate, indicates that the
38+
# workaround is to use the older SDK.
39+
#
40+
# However, the fix given there causes the platform to be
41+
# "ARM64,version=10.0.22621.0", which causes the Visual Studio
42+
# project file to give that as the platform, which causes
43+
# MSBuild to fail because it's expecting something such as just
44+
# "AMD64", so we do it with "-DCMAKE_SYSTEM_VERSION=10.0.22621.0"
45+
# instead.
46+
#
47+
# The problem showed up after an upgrade of the AppVeyor image.
48+
# It may be that the VS 2019 VC headers and the Windows 11 SDK
49+
# (10.0.26100.0) don't work together on ARM64, and that this is
50+
# a consequence of having an image with both VS 2019 and VS 2022
51+
# both installed.
52+
#
2953
matrix:
3054
# VS 2017, WinPcap, 32-bit and 64-bit x86, with remote
3155
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
@@ -93,12 +117,14 @@ environment:
93117
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
94118
GENERATOR: "Visual Studio 16 2019"
95119
PLATFORM: ARM64
120+
CMAKE_SYSTEM_VERSION: "-DCMAKE_SYSTEM_VERSION=10.0.22621.0"
96121
SDK: npcap-sdk
97122
REMOTE: -DENABLE_REMOTE=NO
98123
# VS 2019, Npcap, 64-bit ARM, with remote
99124
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
100125
GENERATOR: "Visual Studio 16 2019"
101126
PLATFORM: ARM64
127+
CMAKE_SYSTEM_VERSION: "-DCMAKE_SYSTEM_VERSION=10.0.22621.0"
102128
SDK: npcap-sdk
103129
OPENSSL_ROOT_DIR: -DOPENSSL_ROOT_DIR=C:\OpenSSL-v33-Win64\bin
104130
# VS 2022, WinPcap, 32-bit and 64-bit x86, without remote
@@ -167,5 +193,5 @@ build_script:
167193
- md build
168194
- cd build
169195
- cmake --version
170-
- cmake %REMOTE% %OPENSSL_ROOT_DIR% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -G"%GENERATOR%" -A %PLATFORM% ..
196+
- cmake %REMOTE% %OPENSSL_ROOT_DIR% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -G"%GENERATOR%" -A %PLATFORM% %CMAKE_SYSTEM_VERSION% ..
171197
- msbuild /m /nologo /p:Configuration=Release pcap.sln

0 commit comments

Comments
 (0)