Skip to content

Commit 11dae0e

Browse files
rado17kartben
authored andcommitted
net: l2: wifi: Add checks for cert header creation
Execute certificate headers creation rules only if Wi-Fi Enterprise mode is enabled. Signed-off-by: Ravi Dondaputi <[email protected]>
1 parent c120f4f commit 11dae0e

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

subsys/net/l2/wifi/CMakeLists.txt

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,65 +23,65 @@ if (CONFIG_WIFI_NM)
2323
zephyr_iterable_section(NAME wifi_nm_instance GROUP DATA_REGION ${XIP_ALIGN_WITH_INPUT} SUBALIGN ${CONFIG_LINKER_ITERABLE_SUBALIGN})
2424
endif()
2525

26-
# Wi-Fi Enterprise test certificates handling
27-
set(gen_inc_dir ${ZEPHYR_BINARY_DIR}/misc/generated)
28-
set(gen_dir ${gen_inc_dir}/wifi_enterprise_test_certs)
29-
# Create output directory for test certs
30-
file(MAKE_DIRECTORY ${gen_dir})
26+
if(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE AND CONFIG_NET_L2_WIFI_SHELL)
27+
# Wi-Fi Enterprise test certificates handling
28+
set(gen_inc_dir ${ZEPHYR_BINARY_DIR}/misc/generated)
29+
set(gen_dir ${gen_inc_dir}/wifi_enterprise_test_certs)
30+
# Create output directory for test certs
31+
file(MAKE_DIRECTORY ${gen_dir})
3132

32-
# convert .pem files to array data at build time
33-
zephyr_include_directories(${gen_inc_dir})
33+
# convert .pem files to array data at build time
34+
zephyr_include_directories(${gen_inc_dir})
3435

35-
if (CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE)
36-
generate_inc_file_for_target(
37-
app
38-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client.pem
39-
${gen_dir}/client.pem.inc
40-
)
36+
generate_inc_file_for_target(
37+
app
38+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client.pem
39+
${gen_dir}/client.pem.inc
40+
)
4141

42-
generate_inc_file_for_target(
43-
app
44-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client-key.pem
45-
${gen_dir}/client-key.pem.inc
46-
)
42+
generate_inc_file_for_target(
43+
app
44+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client-key.pem
45+
${gen_dir}/client-key.pem.inc
46+
)
4747

48-
generate_inc_file_for_target(
49-
app
50-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/ca.pem
51-
${gen_dir}/ca.pem.inc
52-
)
48+
generate_inc_file_for_target(
49+
app
50+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/ca.pem
51+
${gen_dir}/ca.pem.inc
52+
)
5353

54-
generate_inc_file_for_target(
55-
app
56-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client2.pem
57-
${gen_dir}/client2.pem.inc
58-
)
54+
generate_inc_file_for_target(
55+
app
56+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client2.pem
57+
${gen_dir}/client2.pem.inc
58+
)
5959

60-
generate_inc_file_for_target(
61-
app
62-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client-key2.pem
63-
${gen_dir}/client-key2.pem.inc
64-
)
60+
generate_inc_file_for_target(
61+
app
62+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/client-key2.pem
63+
${gen_dir}/client-key2.pem.inc
64+
)
6565

66-
generate_inc_file_for_target(
67-
app
68-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/ca2.pem
69-
${gen_dir}/ca2.pem.inc
70-
)
66+
generate_inc_file_for_target(
67+
app
68+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/ca2.pem
69+
${gen_dir}/ca2.pem.inc
70+
)
7171

72-
generate_inc_file_for_target(
73-
app
74-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/server.pem
75-
${gen_dir}/server.pem.inc
76-
)
72+
generate_inc_file_for_target(
73+
app
74+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/server.pem
75+
${gen_dir}/server.pem.inc
76+
)
7777

78-
generate_inc_file_for_target(
79-
app
80-
${ZEPHYR_BASE}/samples/net/wifi/test_certs/server-key.pem
81-
${gen_dir}/server-key.pem.inc
82-
)
83-
# Add explicit dependency on app target for ZEPHYR_CURRENT_LIBRARY, so these
84-
# headers are generated at the correct point in the build
85-
add_dependencies(${ZEPHYR_CURRENT_LIBRARY} app)
78+
generate_inc_file_for_target(
79+
app
80+
${ZEPHYR_BASE}/samples/net/wifi/test_certs/server-key.pem
81+
${gen_dir}/server-key.pem.inc
82+
)
8683

87-
endif() # CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE
84+
# Add explicit dependency on app target for ZEPHYR_CURRENT_LIBRARY, so these
85+
# headers are generated at the correct point in the build
86+
add_dependencies(${ZEPHYR_CURRENT_LIBRARY} app)
87+
endif() #CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE AND CONFIG_NET_L2_WIFI_SHELL

0 commit comments

Comments
 (0)