Skip to content

Commit 4deda6f

Browse files
committed
cmake: sdp: docs for CMake functions
Add documentation for CMake functions used in SDP. Signed-off-by: Marcin Szymczyk <[email protected]>
1 parent 55b33f8 commit 4deda6f

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

cmake/sdp.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7+
# This function takes as an argument target to be built and path to .c source file(s)
8+
# whose .s output must be verified against .s file tracked in repository. It then:
9+
# - adds a pre-build dependency that generates .s files in build directory
10+
# - adds a dependency on specified target to call sdp_asm_check.cmake with appropriate arguments
11+
# - adds a custom target that calls sdp_asm_install.cmake with appropriate arguments
12+
# - adds .s files from build directory to target sources
13+
#
14+
# Arguments:
15+
# target - target to which the dependencies are to be applied
16+
# hrt_srcs - path to the .c source file(s) to verify
717
function(sdp_assembly_install target hrt_srcs)
818
sdp_assembly_generate(${CONFIG_SOC} "${hrt_srcs}")
919
sdp_assembly_check(${CONFIG_SOC} "${hrt_srcs}")

cmake/sdp_asm_check.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7+
# Function checking if .s file generated during build is identical to one tracked in repository
8+
#
9+
# Arguments:
10+
# hrt_srcs - path to the .c file(s) to verify
11+
# soc - name of the SoC the code is being built for
712
function(asm_check)
813
if(NOT DEFINED soc)
914
message(FATAL_ERROR "asm_check missing soc argument.")

cmake/sdp_asm_install.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7+
# Function that replaces .s file tracked in repository with updated version from build
8+
#
9+
# Arguments:
10+
# hrt_srcs - path to the .c file(s) to verify
11+
# soc - name of the SoC the code is being built for
712
function(asm_install)
813
if(NOT DEFINED soc)
914
message(FATAL_ERROR "asm_install missing soc argument.")

0 commit comments

Comments
 (0)