mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[cmake] using cmake -E echo instead of shell echo command (#6175)
The echo command of the host system may have slight variations between shell built-in echo and the echo command provided by the OS. Especially the Windows OS echo command is different from practical any other echo command. This means that the currently used `COMMAND echo -e "<text>"` does not work universally. This commit introduces `etc/cmake/print.cmake` which allow to print a CMake list where each item is printed on a new line, to get the desired behavior on the `print-ot-config` target. Using `cmake -E echo <text>` ensures identical behaviour across different systems. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
committed by
GitHub
parent
8f57637aec
commit
32257403b0
+5
-1
@@ -194,4 +194,8 @@ endif()
|
||||
|
||||
add_subdirectory(tests)
|
||||
|
||||
add_custom_target(print-ot-config ALL COMMAND echo -e "$<JOIN:$<TARGET_PROPERTY:ot-config,INTERFACE_COMPILE_DEFINITIONS>,\"\\n\">")
|
||||
add_custom_target(print-ot-config ALL
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DLIST="$<TARGET_PROPERTY:ot-config,INTERFACE_COMPILE_DEFINITIONS>"
|
||||
-P ${PROJECT_SOURCE_DIR}/etc/cmake/print.cmake
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user