-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
150 lines (132 loc) · 5.01 KB
/
Copy pathCMakeLists.txt
File metadata and controls
150 lines (132 loc) · 5.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
cmake_minimum_required(VERSION 3.15)
# Set the toolchain file for vcpkg on Windows (only if VCPKG_ROOT is set;
# on mingw we get libusb from pkg-config directly).
if(WIN32 AND NOT "$ENV{VCPKG_ROOT}" STREQUAL "")
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
endif()
project(Rtl8812auNet)
enable_testing()
# Find pkg-config and then use it to locate libusb.
find_package(PkgConfig REQUIRED)
pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
add_library(WiFiDriver
src/logger.h
hal/Hal8812PhyReg.h
hal/Hal8812PwrSeq.c
hal/Hal8812PwrSeq.h
hal/Hal8812a_TxPwrTrack.cpp
hal/Hal8812a_TxPwrTrack.h
hal/Hal8814PwrSeq.c
hal/Hal8814PwrSeq.h
hal/Hal8821APwrSeq.c
hal/Hal8821APwrSeq.h
hal/Hal8821PhyReg.h
hal/basic_types.h
hal/hal8812a_fw.c
hal/hal8812a_fw.h
hal/hal8814a_fw.c
hal/hal8814a_fw.h
hal/hal8821a_fw.c
hal/hal8821a_fw.h
hal/hal_com_reg.h
hal/rtl8812a_hal.h
hal/rtl8812a_recv.h
hal/rtl8812a_spec.h
# RTL8814AU phydm-format register tables. The .c file is generated from the
# aircrack-ng/rtl8814au tree by tools/extract_8814a_phy_tables.py; the
# loader at src/PhyTableLoader walks the same conditional encoding the
# upstream phydm parser does, without pulling in phydm itself.
hal/phydm/rtl8814a/Hal8814_PhyTables.c
hal/phydm/rtl8814a/Hal8814_PhyTables.h
src/ieee80211_radiotap.h
src/BbDbgportReader.cpp
src/BbDbgportReader.h
src/EepromManager.cpp
src/EepromManager.h
src/Firmware.h
src/FirmwareManager.cpp
src/FirmwareManager.h
src/FrameParser.cpp
src/FrameParser.h
src/HalModule.cpp
src/HalModule.h
src/Iqk8812a.cpp
src/Iqk8812a.h
src/Iqk8814a.cpp
src/Iqk8814a.h
src/PhydmWatchdog.cpp
src/PhydmWatchdog.h
src/ParsedRadioPacket.cpp
src/PhyTableLoader.cpp
src/PhyTableLoader.h
src/PowerTracking8812a.cpp
src/PowerTracking8812a.h
src/RadioManagementModule.cpp
src/RadioManagementModule.h
src/Radiotap.c
src/RadiotapBuilder.cpp
src/RadiotapBuilder.h
src/RtlJaguarDevice.cpp
src/RtlJaguarDevice.h
src/RtlUsbAdapter.cpp
src/RtlUsbAdapter.h
src/SelectedChannel.h
src/WiFiDriver.cpp
src/WiFiDriver.h
src/registry_priv.h
)
target_compile_features(WiFiDriver PUBLIC cxx_std_20)
# Link WiFiDriver with libusb as found via pkg-config.
target_link_libraries(WiFiDriver PUBLIC PkgConfig::libusb)
target_include_directories(WiFiDriver PUBLIC hal)
target_include_directories(WiFiDriver PUBLIC hal/phydm/rtl8814a)
target_include_directories(WiFiDriver PUBLIC src)
add_executable(WiFiDriverDemo
demo/main.cpp
)
target_link_libraries(WiFiDriverDemo PUBLIC WiFiDriver)
add_executable(WiFiDriverTxDemo
txdemo/main.cpp
)
target_link_libraries(WiFiDriverTxDemo PUBLIC WiFiDriver PRIVATE PkgConfig::libusb)
# Pre-modulator subcarrier PoC: transmits PSDU bytes shaped by
# tools/precoder/encode_subcarriers.py so chosen OFDM data subcarriers carry
# chosen bits. Single-stream BPSK / HT MCS0 / BCC on 8812/8821/8811.
add_executable(PrecoderDemo
txdemo/precoder_demo/main.cpp
)
target_link_libraries(PrecoderDemo PUBLIC WiFiDriver PRIVATE PkgConfig::libusb)
# Stream-link TX: reads length-prefixed PSDU bodies from stdin and transmits
# one probe-request per body. Driven by tools/precoder/stream_tx.py — the
# C++/Python split keeps libusb out of the framing math.
add_executable(StreamTxDemo
txdemo/stream_tx_demo/main.cpp
)
target_link_libraries(StreamTxDemo PUBLIC WiFiDriver PRIVATE PkgConfig::libusb)
# stream_stdin.h (shared binary-stdin framing) lives in txdemo/.
target_include_directories(StreamTxDemo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/txdemo)
# Stream-link DUPLEX: one binary, one chip, both directions. Combines the RX
# loop from WiFiDriverDemo and the stdin-driven TX from StreamTxDemo —
# stdin = length-prefixed PSDU bodies, stdout = <devourer-stream> lines.
# tools/precoder/tun_p2p.py spawns this for --mode=duplex.
add_executable(StreamDuplexDemo
txdemo/stream_duplex_demo/main.cpp
)
target_link_libraries(StreamDuplexDemo PUBLIC WiFiDriver PRIVATE PkgConfig::libusb)
target_include_directories(StreamDuplexDemo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/txdemo)
# Headless regression guard for the binary-stdin framing shared by the two
# stream demos above (txdemo/stream_stdin.h). No libusb, no radio — just the
# set_stdin_binary() + read_exact() path, so a text-mode regression (e.g. the
# _setmode gate slipping back to _MSC_VER, which is invisible to a build-only
# check) fails `ctest` on the Windows/mingw jobs. See tests/stream_stdin_test.cmake.
add_executable(StreamStdinSelftest
txdemo/stream_stdin_selftest.cpp
)
target_compile_features(StreamStdinSelftest PRIVATE cxx_std_20)
target_include_directories(StreamStdinSelftest PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/txdemo)
add_test(
NAME stream_stdin_binary
COMMAND ${CMAKE_COMMAND}
-DSELFTEST_EXE=$<TARGET_FILE:StreamStdinSelftest>
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/stream_stdin_test.cmake
)