Skip to content

Commit 153be1b

Browse files
arbraunskartben
authored andcommitted
cmake: use external gen_kobject_list binary if available
e.g. https://github.com/arbrauns/gen_kobject_list Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
1 parent d6efbc8 commit 153be1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/kobj.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
set(GEN_KOBJECT_LIST ${ZEPHYR_BASE}/scripts/build/gen_kobject_list.py)
3+
find_program(GEN_KOBJECT_LIST NAMES gen_kobject_list gen_kobject_list.py PATHS ${ZEPHYR_BASE}/scripts/build)
4+
message(STATUS "Found gen_kobject_list: ${GEN_KOBJECT_LIST}")
5+
if(GEN_KOBJECT_LIST MATCHES "\.py$")
6+
set(GEN_KOBJECT_LIST_INTERPRETER ${PYTHON_EXECUTABLE})
7+
endif()
48

59
# Invokes gen_kobject_list.py with the given SCRIPT_ARGS, creating a TARGET that depends on the
610
# script's OUTPUTS
@@ -16,7 +20,7 @@ function(gen_kobject_list)
1620
add_custom_command(
1721
OUTPUT ${arg_OUTPUTS}
1822
COMMAND
19-
${PYTHON_EXECUTABLE}
23+
${GEN_KOBJECT_LIST_INTERPRETER}
2024
${GEN_KOBJECT_LIST}
2125
${arg_SCRIPT_ARGS}
2226
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>

0 commit comments

Comments
 (0)