-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
135 lines (119 loc) · 4.59 KB
/
CMakeLists.txt
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
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Check if ZEPHYR_BASE is set
if(NOT DEFINED ENV{ZEPHYR_BASE})
message(FATAL_ERROR "ZEPHYR_BASE environment variable is not set. Please set it to the Zephyr base directory.")
endif()
if (CONFIG_NRF70_BM_LIB)
if (DEFINED ENV{ZEPHYR_BASE})
# Use Zephyr module
set(NRF_WIFI_DIR ${ZEPHYR_NRF_WIFI_MODULE_DIR})
set(NRF_WIFI_BINS_DIR ${ZEPHYR_NRFXLIB_MODULE_DIR}/nrf_wifi/bin/zephyr)
else()
# Use git submodule
set(NRF_WIFI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../sdk-nrfxlib/nrf_wifi)
set(NRF_WIFI_BINS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../sdk-nrfxlib/nrf_wifi/bin/zephyr)
endif()
add_subdirectory(${NRF_WIFI_DIR} nrf-wifi-osal)
add_library(nrf70-bm-lib STATIC)
target_include_directories(nrf70-bm-lib PUBLIC
include
# Include till the last directory to avoid using Zephyr in BM code
${ZEPHYR_BASE}/include/zephyr
)
target_compile_definitions_ifdef(CONFIG_NRF70_BM_SCAN_ONLY
nrf70-bm-lib
PRIVATE
-DCONFIG_NRF_WIFI_SYS_FW_BIN=${NRF_WIFI_BINS_DIR}/scan_only/nrf70.bin
)
target_compile_definitions_ifdef(CONFIG_NRF70_BM_RADIO_TEST
nrf70-bm-lib
PRIVATE
-DCONFIG_NRF_WIFI_RT_FW_BIN=${NRF_WIFI_BINS_DIR}/radio_test/nrf70.bin
)
target_compile_definitions_ifdef(CONFIG_NRF70_BM_RADIO_TEST
nrf70-bm-lib
PRIVATE
-DCONFIG_NRF70_BM_RADIO_TEST
)
target_compile_definitions_ifdef(CONFIG_NRF70_BM_SCAN_ONLY
nrf70-bm-lib
PRIVATE
-DCONFIG_NRF70_BM_SCAN_ONLY
)
target_sources(
nrf70-bm-lib
PRIVATE
source/common/nrf70_bm_core.c
)
if(CONFIG_NRF70_BM_RADIO_TEST)
target_sources(
nrf70-bm-lib
PRIVATE
source/radio_test/nrf70_bm_lib.c
source/radio_test/nrf70_bm_core.c
)
endif()
if(CONFIG_NRF70_BM_SCAN_ONLY)
target_sources(
nrf70-bm-lib
PRIVATE
source/system/nrf70_bm_lib.c
source/system/nrf70_bm_core.c
)
endif()
target_link_libraries(nrf70-bm-lib PRIVATE nrf70-zep-shim nrf-wifi-osal)
target_compile_options(nrf70-bm-lib PRIVATE
-Wall # All warnings
-Wextra # Extra warnings
-Werror # Warnings as errors
-Wformat=2 # Format string checks
-Wformat-security # Security issues with format strings
-Wnull-dereference # Null pointer dereferences
-Wstack-protector # Stack protection
-fstack-protector-strong # Strong stack protection
-Warray-bounds # Array bounds checking
-Wstringop-overflow # String operation overflow
-Wconversion # Implicit conversions
-Wsign-conversion # Sign conversions
-Wmissing-include-dirs # Missing include directories
-Wcast-align # Pointer cast alignment
-Wcast-qual # Pointer cast dropping qualifiers
-Wdiscarded-qualifiers # Discarded qualifiers
-Wduplicated-branches # Duplicated branches
-Wduplicated-cond # Duplicated conditions
-Wlogical-op # Suspicious logical operators
-Wnull-dereference # Null pointer dereferences
-Wjump-misses-init # Goto skipping variable initialization
-Wunused-parameter # Unused parameters
-Wshift-overflow=2 # Shift overflows
-Wmissing-prototypes # Missing function prototypes
-Wredundant-decls # Redundant declarations
-Wtype-limits # Type limits
-Wshadow # Shadowed variables
-Wstrict-prototypes # Strict prototypes
-Wundef # Undefined macros
-Wuninitialized # Uninitialized variables
-Wpointer-arith # Pointer arithmetic
-Wbad-function-cast # Bad function casts
-Wstrict-overflow # Strict overflow
-Winline # Inlining issues
-Wnested-externs # Nested externs
-Wold-style-definition # Old-style definitions
-Wmissing-declarations # Missing declarations
-Wmissing-noreturn # Missing noreturn
-Wdisabled-optimization # Disabled optimizations
-Wfloat-equal # Floating point equality
-Winit-self # Initialization to self
-Wswitch-default # Missing switch default
-Wswitch-enum # Missing switch enum
-Wunsafe-loop-optimizations # Unsafe loop optimizations
-Wlogical-not-parentheses # Logical not parentheses
-Wstrict-aliasing # Strict aliasing
-Wvariadic-macros # Variadic macros
-Wvolatile-register-var # Volatile register variables
)
endif()