cmake: fix code section ordering
Order the code sections according to their numbering in the table of contents. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
parent
db94cef75d
commit
0d412ab20e
1 changed files with 57 additions and 57 deletions
|
@ -304,63 +304,6 @@ macro(get_property_and_add_prefix result target property prefix)
|
|||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# 1.3 generate_inc_*
|
||||
|
||||
# These functions are useful if there is a need to generate a file
|
||||
# that can be included into the application at build time. The file
|
||||
# can also be compressed automatically when embedding it.
|
||||
#
|
||||
# See tests/application_development/gen_inc_file for an example of
|
||||
# usage.
|
||||
function(generate_inc_file
|
||||
source_file # The source file to be converted to hex
|
||||
generated_file # The generated file
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${generated_file}
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE}
|
||||
${ZEPHYR_BASE}/scripts/file2hex.py
|
||||
${ARGN} # Extra arguments are passed to file2hex.py
|
||||
--file ${source_file}
|
||||
> ${generated_file} # Does pipe redirection work on Windows?
|
||||
DEPENDS ${source_file}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function(generate_inc_file_for_gen_target
|
||||
target # The cmake target that depends on the generated file
|
||||
source_file # The source file to be converted to hex
|
||||
generated_file # The generated file
|
||||
gen_target # The generated file target we depend on
|
||||
# Any additional arguments are passed on to file2hex.py
|
||||
)
|
||||
generate_inc_file(${source_file} ${generated_file} ${ARGN})
|
||||
|
||||
# Ensure 'generated_file' is generated before 'target' by creating a
|
||||
# dependency between the two targets
|
||||
|
||||
add_dependencies(${target} ${gen_target})
|
||||
endfunction()
|
||||
|
||||
function(generate_inc_file_for_target
|
||||
target # The cmake target that depends on the generated file
|
||||
source_file # The source file to be converted to hex
|
||||
generated_file # The generated file
|
||||
# Any additional arguments are passed on to file2hex.py
|
||||
)
|
||||
# Ensure 'generated_file' is generated before 'target' by creating a
|
||||
# 'custom_target' for it and setting up a dependency between the two
|
||||
# targets
|
||||
|
||||
# But first create a unique name for the custom target
|
||||
generate_unique_target_name_from_filename(${generated_file} generated_target_name)
|
||||
|
||||
add_custom_target(${generated_target_name} DEPENDS ${generated_file})
|
||||
generate_inc_file_for_gen_target(${target} ${source_file} ${generated_file} ${generated_target_name} ${ARGN})
|
||||
endfunction()
|
||||
|
||||
# 1.2 zephyr_library_*
|
||||
#
|
||||
# Zephyr libraries use CMake's library concept and a set of
|
||||
|
@ -516,6 +459,63 @@ macro(zephyr_interface_library_named name)
|
|||
set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS ${name})
|
||||
endmacro()
|
||||
|
||||
# 1.3 generate_inc_*
|
||||
|
||||
# These functions are useful if there is a need to generate a file
|
||||
# that can be included into the application at build time. The file
|
||||
# can also be compressed automatically when embedding it.
|
||||
#
|
||||
# See tests/application_development/gen_inc_file for an example of
|
||||
# usage.
|
||||
function(generate_inc_file
|
||||
source_file # The source file to be converted to hex
|
||||
generated_file # The generated file
|
||||
)
|
||||
add_custom_command(
|
||||
OUTPUT ${generated_file}
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE}
|
||||
${ZEPHYR_BASE}/scripts/file2hex.py
|
||||
${ARGN} # Extra arguments are passed to file2hex.py
|
||||
--file ${source_file}
|
||||
> ${generated_file} # Does pipe redirection work on Windows?
|
||||
DEPENDS ${source_file}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function(generate_inc_file_for_gen_target
|
||||
target # The cmake target that depends on the generated file
|
||||
source_file # The source file to be converted to hex
|
||||
generated_file # The generated file
|
||||
gen_target # The generated file target we depend on
|
||||
# Any additional arguments are passed on to file2hex.py
|
||||
)
|
||||
generate_inc_file(${source_file} ${generated_file} ${ARGN})
|
||||
|
||||
# Ensure 'generated_file' is generated before 'target' by creating a
|
||||
# dependency between the two targets
|
||||
|
||||
add_dependencies(${target} ${gen_target})
|
||||
endfunction()
|
||||
|
||||
function(generate_inc_file_for_target
|
||||
target # The cmake target that depends on the generated file
|
||||
source_file # The source file to be converted to hex
|
||||
generated_file # The generated file
|
||||
# Any additional arguments are passed on to file2hex.py
|
||||
)
|
||||
# Ensure 'generated_file' is generated before 'target' by creating a
|
||||
# 'custom_target' for it and setting up a dependency between the two
|
||||
# targets
|
||||
|
||||
# But first create a unique name for the custom target
|
||||
generate_unique_target_name_from_filename(${generated_file} generated_target_name)
|
||||
|
||||
add_custom_target(${generated_target_name} DEPENDS ${generated_file})
|
||||
generate_inc_file_for_gen_target(${target} ${source_file} ${generated_file} ${generated_target_name} ${ARGN})
|
||||
endfunction()
|
||||
|
||||
# 1.4. board_*
|
||||
#
|
||||
# This section is for extensions which control Zephyr's board runners
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue