Skip to content

Commit 9b8d309

Browse files
committed
WakeOnLan: PcapPlusPlus in vcpkg relies on WinPcap, but WinPcap does not work in Windows 10.
So compile from source, relying on the npcap library.
1 parent 4e5db67 commit 9b8d309

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

.github/workflows/msvc.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
VCPKG_DEFAULT_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}}
5252
VCPKG_PLATFORM_TOOLSET: ${{matrix.VCPKG_PLATFORM_TOOLSET}}
5353
VCPKG_OVERLAY_PORTS: "${{github.workspace}}/${{matrix.VCPKG_OVERLAY_PORTS}}"
54-
VCPKG_MANIFEST_FEATURES: "freerdp;vnc;wol"
54+
VCPKG_MANIFEST_FEATURES: "freerdp;vnc"
5555
CMAKE_GENERATOR: "Visual Studio 17 2022"
5656
CMAKE_GENERATOR_PLATFORM: ${{matrix.CMAKE_GENERATOR_PLATFORM}}
5757
qt_modules: ${{matrix.qt_modules}}
@@ -108,6 +108,8 @@ jobs:
108108
C:\msys64\usr\bin\unzip -d ${{env.INSTALL_DIR}}\npcap npcap-sdk-1.13.zip
109109
)
110110
111+
# 因为 vcpkg 中 PcapPlusPlus 依赖 winpcap , winpcap 不能在 windows 10 上工作,
112+
# 所以编译依赖于 npcap
111113
- name: build PcapPlusPlus
112114
working-directory: ${{env.SOURCE_DIR}}
113115
run: |
@@ -361,15 +363,16 @@ jobs:
361363
-DRABBIT_ENABLE_INSTALL_DEPENDENT=OFF ^
362364
-DRABBIT_ENABLE_INSTALL_QT=ON ^
363365
-DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=OFF ^
366+
-DBUILD_FREERDP=ON ^
364367
-DLibVNCServer_DIR="${{env.INSTALL_DIR}}/lib/cmake/LibVNCServer" ^
365368
-DRabbitVNC_DIR=${{env.INSTALL_DIR}}/lib/cmake/RabbitVNC ^
366369
-Dtigervnc_DIR=${{env.INSTALL_DIR}}/lib/cmake/tigervnc ^
367370
-DQXmpp_DIR=${{env.INSTALL_DIR}}/lib/cmake/qxmpp ^
368371
-DQtService_DIR=${{env.INSTALL_DIR}}/lib/cmake/QtService ^
372+
-DQtService_DIR=${{env.INSTALL_DIR}}/lib/cmake/QtService ^
369373
-DPcapPlusPlus_DIR=${{env.INSTALL_DIR}}/lib/cmake/pcapplusplus ^
370374
-DPCAP_ROOT=${{env.INSTALL_DIR}}/npcap ^
371-
-DPacket_ROOT=${{env.INSTALL_DIR}}/npcap ^
372-
-DBUILD_FREERDP=ON
375+
-DPacket_ROOT=${{env.INSTALL_DIR}}/npcap
373376
cmake --build . --config ${{matrix.BUILD_TYPE}}
374377
IF "${{matrix.BUILD_TYPE}}" == "Release" (
375378
echo "cmake install config: ${{matrix.BUILD_TYPE}} component: DependLibraries"

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"RABBIT_ENABLE_INSTALL_DEPENDENT": "ON",
3737
"RABBIT_ENABLE_INSTALL_QT": "ON",
3838
"RABBIT_ENABLE_INSTALL_TO_BUILD_PATH": "OFF",
39-
"VCPKG_MANIFEST_FEATURES": "freerdp;vnc;wol"
39+
"VCPKG_MANIFEST_FEATURES": "freerdp;vnc"
4040
}
4141
},
4242
{

docs/Compile/Windows.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ Source-code location: https://github.com/KangLin/tigervnc
298298
cd vcpkg
299299
vcpkg install pcapplusplus
300300

301+
**Note**: PcapPlusPlus in vcpkg relies on WinPcap,
302+
but WinPcap does not work in Windows 10.
303+
So compile from source, relying on the npcap library.
304+
301305
- When PcapPlusPlus is compiled from source,
302306
the CMake parameter needs to be specified to compile this project:
303307

docs/Compile/Windows_zh_CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@
282282
cd vcpkg
283283
vcpkg install pcapplusplus
284284

285+
**注意**: vcpkg 中 PcapPlusPlus 依赖 WinPcap,但 WinPcap 不能在 Windows 10 工作。
286+
所以从源码编译,依赖 npcap 库。
287+
285288
- 当 PcapPlusPlus 从源码编译时,编译本项需要指定的 CMake 参数:
286289

287290
-DPcapPlusPlus_DIR=[PcapPlusPlus 安装目录]/lib/cmake/pcapplusplus

vcpkg.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
"default-features": [
2222
"freerdp",
23-
"vnc",
24-
"wol"
23+
"vnc"
2524
],
2625

2726
"features": {
@@ -57,7 +56,7 @@
5756
},
5857

5958
"wol" : {
60-
"description": "Wake on lan",
59+
"description": "Wake on lan. Note: the PcapPlusPlus in vcpkg relies on WinPcap, but WinPcap does not work in Windows 10. So compile from source, relying on the npcap library.",
6160
"dependencies": [
6261
"pcapplusplus"
6362
]

0 commit comments

Comments
 (0)