Skip to content

Commit df374f0

Browse files
committed
tests/lib/cpp/cxx: remove inline comments from DTS-generated headers
The DTS extraction process generates headers with inline comments, which are not supported by the C preprocessor. This is causing build failures when using the generated headers in C++ code. Signed-off-by: Luca Burelli<[email protected]>
1 parent d9ec396 commit df374f0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/lib/cpp/cxx/CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3+
# C++ support is enabled by prj.conf, but since Kconfig options are processed
4+
# after the DTS extraction, the following argument must be passed manually to
5+
# avoid issues like:
6+
#
7+
# zephyr/devicetree_generated.h:2155:95: error: pasting "/* 0x58022400 */" and "U"
8+
# does not give a valid preprocessing token
9+
# 2155 | #define DT_N_S_soc_S_<...>_REG_IDX_0_VAL_ADDRESS 1476535296 /* 0x58022400 */
10+
# ^~~~~~~~~~~~~~~~
11+
#
12+
set(EXTRA_GEN_DEFINES_ARGS --no-inline-comments)
13+
314
cmake_minimum_required(VERSION 3.20.0)
415
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
516
project(cpp)

0 commit comments

Comments
 (0)