SDK CMake API Reference

This page was auto-generated from cmake source files using generate_cmake_rst.py

Public CMake functions / macros

  • add_subdirectory_ifdef()

  • add_subdirectory_ifndef()

  • generate_iar_project()

  • generate_ide_projects()

  • generate_ses_project()

  • sdk_app_inc()

  • sdk_app_src()

  • sdk_app_src_glob()

  • sdk_check_enabled_fpu()

  • sdk_clear_compile_options()

  • sdk_compile_definitions()

  • sdk_compile_definitions_ifdef()

  • sdk_compile_options()

  • sdk_gcc_inc()

  • sdk_gcc_src()

  • sdk_gcc_src_glob()

  • sdk_gcc_startup_src()

  • sdk_get_compile_options()

  • sdk_iar_asm_preinclude()

  • sdk_iar_cc_preinclude()

  • sdk_iar_compile_definitions()

  • sdk_iar_compile_options()

  • sdk_iar_enable_andesperf()

  • sdk_iar_enable_dsp()

  • sdk_iar_enable_no_size_constraints()

  • sdk_iar_inc()

  • sdk_iar_link_libraries()

  • sdk_iar_src()

  • sdk_iar_src_glob()

  • sdk_iar_startup_src()

  • sdk_inc()

  • sdk_inc_ifdef()

  • sdk_inc_ifndef()

  • sdk_ld_options()

  • sdk_ld_options_ifdef()

  • sdk_link_libraries()

  • sdk_link_libraries_ifdef()

  • sdk_linker_global_symbols()

  • sdk_nds_compile_definitions()

  • sdk_nds_compile_options()

  • sdk_nds_ld_options()

  • sdk_nds_link_libraries()

  • sdk_raise_fatal_error_if_all_invalid()

  • sdk_raise_fatal_error_if_all_valid()

  • sdk_raise_fatal_error_if_valid_at_least_one()

  • sdk_ses_compile_definitions()

  • sdk_ses_compile_options()

  • sdk_ses_inc()

  • sdk_ses_link_libraries()

  • sdk_ses_opt_debug_connection()

  • sdk_ses_opt_debug_jlink_speed()

  • sdk_ses_opt_lib_io_type()

  • sdk_ses_options()

  • sdk_ses_set_bss_placement()

  • sdk_ses_set_bss_placement_debug()

  • sdk_ses_set_bss_placement_release()

  • sdk_ses_set_code_placement()

  • sdk_ses_set_code_placement_debug()

  • sdk_ses_set_code_placement_release()

  • sdk_ses_set_const_placement()

  • sdk_ses_set_const_placement_debug()

  • sdk_ses_set_const_placement_release()

  • sdk_ses_set_data_placement()

  • sdk_ses_set_data_placement_debug()

  • sdk_ses_set_data_placement_release()

  • sdk_ses_set_isr_placement()

  • sdk_ses_set_isr_placement_debug()

  • sdk_ses_set_isr_placement_release()

  • sdk_ses_set_optimization_level()

  • sdk_ses_set_optimization_level_debug()

  • sdk_ses_set_optimization_level_release()

  • sdk_ses_set_vector_placement()

  • sdk_ses_set_vector_placement_debug()

  • sdk_ses_set_vector_placement_release()

  • sdk_ses_src()

  • sdk_ses_src_glob()

  • sdk_ses_startup_src()

  • sdk_src()

  • sdk_src_glob()

  • sdk_src_glob_ifdef()

  • sdk_src_glob_ifndef()

  • sdk_src_ifdef()

  • sdk_src_ifndef()

  • sdk_sys_inc()

  • sdk_zcc_compile_definitions()

  • sdk_zcc_compile_options()

  • sdk_zcc_ld_options()

  • sdk_zcc_link_libraries()

add_subdirectory_ifdef

add_subdirectory_ifdef(feature)

[function defined in cmake-ext.cmake]

Add a subdirectory if a feature is enabled

This function adds subdirectories to the build if a specified feature is enabled. It takes a feature flag and a list of directories to add. If the feature is enabled, each directory in the list is added as a subdirectory.

Example:

add_subdirectory_ifdef(FEATURE_X subdir1 subdir2)

Param feature:

The feature flag to check.

Param ARGN:

The list of directories to add as subdirectories.

add_subdirectory_ifndef

add_subdirectory_ifndef(feature, dir)

[function defined in cmake-ext.cmake]

Add directory if feature is false

This function adds a subdirectory to the build if a specified feature is not enabled. It takes a feature flag and a directory path. If the feature is not defined or is set to “0”, the directory is added as a subdirectory.

Example:

add_subdirectory_ifndef(FEATURE_X subdir)

Param feature:

The feature flag to check.

Param dir:

The directory to add as a subdirectory.

generate_iar_project

generate_iar_project()

[function defined in ide/iar.cmake]

Generate IAR project

This function generates an IAR Embedded Workbench project file. It collects various properties and configurations from the CMake project and writes them to a JSON file, which is then used to generate the IAR project.

Example:

generate_iar_project()

Param None:

This function does not take any parameters.

generate_ide_projects

generate_ide_projects()

[function defined in ide.cmake]

Generate IDE projects for all supported IDEs

This function generates project files for all supported IDEs (IAR Embedded Workbench and Segger Embedded Studio). It is a convenience wrapper that calls generate_iar_project() and generate_ses_project() internally. IDEs can be excluded via the EXCLUDED_IDES variable.

Example:

generate_ide_projects()

Param None:

This function does not take any parameters.

generate_ses_project

generate_ses_project()

[function defined in ide/segger.cmake]

Generate Segger Embedded Studio (SES) project

This function generates a Segger Embedded Studio (SES) project file. It collects various properties and configurations from the CMake project and writes them to a JSON file, which is then used to generate the SES project.

Example:

generate_ses_project()

Param None:

This function does not take any parameters.

sdk_app_inc

sdk_app_inc()

[function defined in cmake-ext.cmake]

Add application-specific include paths

This function adds include directories to the application target. It accepts one or more include directory paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. The include paths are added with PUBLIC visibility, meaning they will be propagated to targets that link against the application target.

Example:

sdk_app_inc(app_include) sdk_app_inc(app_include1 app_include2)

Param INC_PATH:

Include directories to be added with PUBLIC visibility.

sdk_app_src

sdk_app_src()

[function defined in cmake-ext.cmake]

Add application source files

This function adds source files to the application target. It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_app_src(app_file.c) sdk_app_src(app_file1.c app_file2.c)

Param SOURCE_FILE:

Source files to be added to the application.

sdk_app_src_glob

sdk_app_src_glob()

[function defined in cmake-ext.cmake]

Add application source files (glob pattern)

This function adds source files to the application target using a glob pattern. It accepts one or more glob patterns as arguments. The files matching the patterns are added to the application target.

Example:

sdk_app_src_glob(“app/**/*.c”)

Param SOURCE_FILE_GLOB:

Glob patterns to specify source files to be added to the application, such as “app/**/*.c” to add all .c files under the app directory recursively.

sdk_check_enabled_fpu

sdk_check_enabled_fpu(output_var, arch, abi)

[function defined in cmake-ext.cmake]

Check the FPU type enabled by the given RISC-V architecture and ABI.

Returns one of the following values via the output variable:

“double” - Double-precision floating point (arch has ‘d’/’g’, abi ends with ‘d’) “single” - Single-precision floating point (arch has ‘f’ but not ‘d’, abi ends with ‘f’) “soft” - Software floating point (no FP extension or abi is integer-only)

RISC-V ISA notes:
  • ‘g’ is a shorthand for ‘imafd’ (includes both ‘f’ and ‘d’)

  • ABI conventions: ilp32/ilp64 (soft), ilp32f/lp64f (single), ilp32d/lp64d (double)

Example:

sdk_check_enabled_fpu(FPU_TYPE “rv32imafdc” “ilp32d”) # FPU_TYPE = “double”

sdk_check_enabled_fpu(FPU_TYPE “rv32imafc” “ilp32f”) # FPU_TYPE = “single”

sdk_check_enabled_fpu(FPU_TYPE “rv32imac” “ilp32”) # FPU_TYPE = “soft”

Param output_var:

Variable name to store the result (“double”, “single”, or “soft”)

Param arch:

RISC-V architecture string (e.g. rv32imafdc, rv32imac_zicsr_zifencei)

Param abi:

RISC-V ABI string (e.g. ilp32, ilp32f, ilp32d)

sdk_clear_compile_options

sdk_clear_compile_options()

[function defined in cmake-ext.cmake]

Clear all compile options for the HPM SDK interface library

This function clears all compile options for the HPM SDK interface library (HPM_SDK_LIB_ITF). It sets the INTERFACE_COMPILE_OPTIONS property to an empty string, effectively removing any previously set compile options.

Example:

sdk_clear_compile_options()

sdk_compile_definitions

sdk_compile_definitions()

[function defined in cmake-ext.cmake]

Set compile definitions

This function sets compile definitions for the HPM SDK interface library (HPM_SDK_LIB_ITF). It accepts one or more preprocessor definitions as arguments. These definitions are added with INTERFACE visibility, meaning they will be applied to any target that links against the HPM_SDK_LIB_ITF target. This is useful for defining macros that should be available across multiple projects or modules.

Example:

sdk_compile_definitions(DEBUG) sdk_compile_definitions(ENABLE_FEATURE_X)

Param def:

compiler preprocessing definitions to be added with INTERFACE visibility

sdk_compile_definitions_ifdef

sdk_compile_definitions_ifdef(feature)

[function defined in cmake-ext.cmake]

Set compile definitions if feature is true

This function sets compile definitions for the HPM SDK interface library (HPM_SDK_LIB_ITF) only if a specified feature is enabled. It accepts one or more preprocessor definitions as arguments. These definitions are added with INTERFACE visibility, meaning they will be applied to any target that links against the HPM_SDK_LIB_ITF target. This is useful for conditionally defining macros based on feature flags.

Example:

sdk_compile_definitions_ifdef(FEATURE_X DEBUG) sdk_compile_definitions_ifdef(FEATURE_Y ENABLE_FEATURE_Y)

Param feature:

the feature flag to check

Param def:

compiler preprocessing definitions to be added with INTERFACE visibility

sdk_compile_options

sdk_compile_options()

[function defined in cmake-ext.cmake]

Set compile options

This function sets compile options for the HPM SDK interface library (HPM_SDK_LIB_ITF). It accepts one or more compile options as arguments. These options are added with INTERFACE visibility, meaning they will be applied to any target that links against the HPM_SDK_LIB_ITF target. This is useful for specifying compiler flags that should be used consistently across multiple projects or modules.

Example:

sdk_compile_options(-Wall -Wextra) sdk_compile_options(-O2)

Param opts:

compile options to be added with INTERFACE visibility

sdk_gcc_inc

sdk_gcc_inc()

[function defined in cmake-ext.cmake]

Add include path for gcc

This function adds include directories to the GCC interface library (HPM_SDK_GCC_LIB_ITF). It accepts one or more include directory paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. The include paths are added with INTERFACE visibility, meaning they will be propagated to targets that link against the HPM_SDK_GCC_LIB_ITF target.

Example:

sdk_gcc_inc(INC_PATH)

Param INC_PATH:

Include directories to be added with INTERFACE visibility.

sdk_gcc_src

sdk_gcc_src()

[function defined in cmake-ext.cmake]

Add source specifically for gcc

This function adds source files to the GCC library (HPM_SDK_GCC_LIB). It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_gcc_src(SOURCE_FILE)

Param SOURCE_FILE:

Source files to be added to HPM_SDK_GCC_LIB.

sdk_gcc_src_glob

sdk_gcc_src_glob()

[function defined in cmake-ext.cmake]

Add source files (glob pattern) for GCC

This function adds source files to the GCC target using a glob pattern. It accepts one or more glob patterns as arguments. The files matching the patterns are added to the GCC target.

Example:

sdk_gcc_src_glob(“gcc/**/*.c”)

Param SOURCE_FILE_GLOB:

Glob patterns to specify source files to be added to GCC, such as “gcc/**/*.c” to add all .c files under the gcc directory recursively.

sdk_gcc_startup_src

sdk_gcc_startup_src()

[function defined in cmake-ext.cmake]

Add source specifically for gcc startup

This function adds source files to the GCC startup library (HPM_SDK_GCC_STARTUP_LIB). It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_gcc_startup_src(SOURCE_FILE)

Param SOURCE_FILE:

Source files to be added to HPM_SDK_GCC_STARTUP_LIB.

sdk_get_compile_options

sdk_get_compile_options(opts)

[function defined in cmake-ext.cmake]

Get all compiler options

This function retrieves all compiler options configured for the current project and returns them as a single space-separated string.

Example:

sdk_get_compile_options(opts)

Param opts:

The variable to store the space-separated compiler options

sdk_iar_asm_preinclude

sdk_iar_asm_preinclude(file)

[function defined in ide/iar.cmake]

Set asm preinclude for IAR

This function sets an assembly preinclude file for the IAR project.

Example:

sdk_iar_asm_preinclude(“preinclude_file.s”)

Param file:

The assembly preinclude file path.

sdk_iar_cc_preinclude

sdk_iar_cc_preinclude(file)

[function defined in ide/iar.cmake]

Set cc preinclude for IAR

This function sets a C/C++ preinclude file for the IAR project.

Example:

sdk_iar_cc_preinclude(“preinclude_file.h”)

Param file:

The C/C++ preinclude file path.

sdk_iar_compile_definitions

sdk_iar_compile_definitions()

[function defined in ide/iar.cmake]

Set compile definitions for IAR

This function sets compile definitions for the IAR interface library. It accepts one or more preprocessor definitions as arguments. These definitions are added with INTERFACE visibility, meaning they will be applied to any target that links against the IAR interface library.

Example:

sdk_iar_compile_definitions(-DDEBUG -DVERSION=1)

Param def:

Compiler preprocessing definitions to be added with INTERFACE visibility.

sdk_iar_compile_options

sdk_iar_compile_options()

[function defined in ide/iar.cmake]

Set compile options for IAR

This function sets compile options for the IAR interface library. It accepts one or more compile options as arguments. These options are added with INTERFACE visibility, meaning they will be applied to any target that links against the IAR interface library.

Example:

sdk_iar_compile_options(-O2 -g)

Param opts:

Compile options to be added with INTERFACE visibility.

sdk_iar_enable_andesperf

sdk_iar_enable_andesperf()

[function defined in ide/iar.cmake]

Enable IAR Andes performance extension

This function enables the Andes performance extension in the IAR project.

Example:

sdk_iar_enable_andesperf()

Param None:

This function does not take any parameters.

sdk_iar_enable_dsp

sdk_iar_enable_dsp()

[function defined in ide/iar.cmake]

Enable DSP in IAR

This function enables DSP support in the IAR project.

Example:

sdk_iar_enable_dsp()

Param None:

This function does not take any parameters.

sdk_iar_enable_no_size_constraints

sdk_iar_enable_no_size_constraints()

[function defined in ide/iar.cmake]

Enable no size constraints in IAR

This function enables the no size constraints option in the IAR project.

Example:

sdk_iar_enable_no_size_constraints()

Param None:

This function does not take any parameters.

sdk_iar_inc

sdk_iar_inc()

[function defined in ide/iar.cmake]

Add include path for IAR

This function adds include directories to the IAR interface library. It accepts one or more include directory paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory.

Example:

sdk_iar_inc(include)

Param inc:

Include directories to be added with INTERFACE visibility.

sdk_iar_src

sdk_iar_src()

[function defined in ide/iar.cmake]

Add source file for IAR

This function adds source files to the IAR library. It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_iar_src(source_file.c)

Param SOURCE_FILE:

Source files to be added to the IAR library.

sdk_iar_src_glob

sdk_iar_src_glob()

[function defined in ide/iar.cmake]

Add source file (glob pattern) for IAR

This function adds source files to the IAR library using a glob pattern. It accepts one or more glob patterns as arguments. The files matching the patterns are added to the IAR library.

Example:

sdk_iar_src_glob(“src/**/*.c”)

Param SOURCE_FILE_GLOB:

Glob patterns to specify source files to be added to IAR.

sdk_iar_startup_src

sdk_iar_startup_src()

[function defined in ide/iar.cmake]

Add source file for IAR startup

This function adds source files to the IAR startup library. It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_iar_startup_src(startup_file.c)

Param STARTUP_SOURCE_FILE:

Source files to be added to the IAR startup library.

sdk_inc

sdk_inc()

[function defined in cmake-ext.cmake]

Add include path

This function adds include directories to the HPM SDK interface library (HPM_SDK_LIB_ITF). It accepts one or more include directory paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. The include paths are added with INTERFACE visibility, meaning they will be propagated to targets that link against the HPM_SDK_LIB_ITF target.

Example:

sdk_inc(INC_PATH) sdk_inc(include) sdk_inc(include1 include2) sdk_inc(${PROJECT_SOURCE_DIR}/include)

Param INC_PATH:

include directories to be added with INTERFACE visibility

sdk_inc_ifdef

sdk_inc_ifdef(feature)

[function defined in cmake-ext.cmake]

Add include paths if a feature is enabled

This function adds include directories to the build if a specified feature is enabled. It takes a feature flag and a list of include paths to add. If the feature is enabled, each path in the list is added using sdk_inc.

Example:

sdk_inc_ifdef(FEATURE_Y include1 include2)

Param feature:

The feature flag to check.

Param ARGN:

The list of include paths to add.

sdk_inc_ifndef

sdk_inc_ifndef(feature)

[function defined in cmake-ext.cmake]

Add include paths if a feature is not enabled

This function adds include directories to the build if a specified feature is not enabled. It takes a feature flag and a list of include paths to add. If the feature is not defined or is set to 0, each path in the list is added using sdk_inc.

Example:

sdk_inc_ifndef(FEATURE_Z include3 include4)

Param feature:

The feature flag to check.

Param ARGN:

The list of include paths to add.

sdk_ld_options

sdk_ld_options()

[function defined in cmake-ext.cmake]

Set linker options

This function sets linker options for the HPM SDK interface library (HPM_SDK_LIB_ITF). It accepts one or more linker options as arguments. These options are added with INTERFACE visibility, meaning they will be applied to any target that links against the HPM_SDK_LIB_ITF target. This is useful for specifying linker flags that should be used consistently across multiple projects or modules.

Example:

sdk_ld_options(-Wl,–start-group) sdk_ld_options(-Wl,–end-group)

Param opts:

linker options to be added with INTERFACE visibility

sdk_ld_options_ifdef

sdk_ld_options_ifdef(feature)

[function defined in cmake-ext.cmake]

Set linker options if feature is true

This function sets linker options for the HPM SDK interface library (HPM_SDK_LIB_ITF) only if a specified feature is enabled. It accepts one or more linker options as arguments. These options are added with INTERFACE visibility, meaning they will be applied to any target that links against the HPM_SDK_LIB_ITF target, but only if the feature flag is set. This is useful for conditionally applying linker flags based on feature flags.

Example:

sdk_ld_options_ifdef(FEATURE_X -Wl,–start-group) sdk_ld_options_ifdef(FEATURE_Y -Wl,–end-group)

Param feature:

the feature flag to check

Param opts:

linker options to be added with INTERFACE visibility

sdk_linker_global_symbols

sdk_linker_global_symbols()

[function defined in cmake-ext.cmake]

Define global symbols for linker

This function defines global symbols for the linker in the HPM SDK interface library (HPM_SDK_LIB_ITF). It accepts one or more symbol names as arguments. These symbols are passed to the linker using the -Xlinker –defsym option, which allows defining symbols with specific values. This can be useful for setting global variables or constants at link time.

Example:

sdk_linker_global_symbols(SYMBOL_NAME) sdk_linker_global_symbols(SYMBOL1 SYMBOL2)

Param syms:

symbols for linker to be defined globally

sdk_nds_compile_definitions

sdk_nds_compile_definitions()

[function defined in cmake-ext.cmake]

Set compile definitions for the NDS toolchain

This function sets compile definitions for the NDS toolchain by adding them with INTERFACE visibility to the HPM_SDK_NDSGCC_LIB_ITF target. This ensures that the definitions are applied to any target that links against the NDS toolchain interface library.

Example:

sdk_nds_compile_definitions(-DDEBUG -DVERSION=1)

Param ARGN:

The list of compile definitions for the NDS toolchain.

sdk_nds_compile_options

sdk_nds_compile_options()

[function defined in cmake-ext.cmake]

Set compile options for the NDS toolchain

This function sets compile options for the NDS toolchain by adding them with INTERFACE visibility to the HPM_SDK_NDSGCC_LIB_ITF target. This ensures that the options are applied to any target that links against the NDS toolchain interface library.

Example:

sdk_nds_compile_options(-O2 -g)

Param ARGN:

The list of compile options for the NDS toolchain.

sdk_nds_ld_options

sdk_nds_ld_options()

[function defined in cmake-ext.cmake]

Set linker options for Andes toolchains

This function sets linker options for the Andes toolchain by adding them with INTERFACE visibility to the HPM_SDK_NDSGCC_LIB_ITF target. This ensures that the options are applied to any target that links against the Andes toolchain interface library.

Example:

sdk_nds_ld_options(-Wl,–start-group -Wl,–end-group)

Param opts:

Linker options to be added with INTERFACE visibility.

sdk_raise_fatal_error_if_all_invalid

sdk_raise_fatal_error_if_all_invalid()

[function defined in cmake-ext.cmake]

Raise fatal error if all given features are not set or set to 0 or n

This function checks a list of feature flags and raises a fatal error if all of them are either not set or set to 0 or n. It is useful for ensuring that at least one feature is enabled in a given set.

Example:

sdk_raise_fatal_error_if_all_invalid(FEATUREA FEATUREB)

Param ARGN:

The list of feature flags to check.

sdk_raise_fatal_error_if_all_valid

sdk_raise_fatal_error_if_all_valid()

[function defined in cmake-ext.cmake]

Raise fatal error if all given features are set or set to 1 or y

This function checks a list of feature flags and raises a fatal error if all of them are set to 1 or y. It is useful for ensuring that not all features are enabled simultaneously.

Example:

sdk_raise_fatal_error_if_all_valid(FEATUREA FEATUREB)

Param ARGN:

The list of feature flags to check.

sdk_raise_fatal_error_if_valid_at_least_one

sdk_raise_fatal_error_if_valid_at_least_one()

[function defined in cmake-ext.cmake]

Raise fatal error if none of the given features is set or set to 1 or y

This function checks a list of feature flags and raises a fatal error if none of them is set to 1 or y. It is useful for ensuring that at least one feature is enabled in a given set.

Example:

sdk_raise_fatal_error_if_valid_at_least_one(FEATUREA FEATUREB)

Param ARGN:

The list of feature flags to check.

sdk_ses_compile_definitions

sdk_ses_compile_definitions()

[function defined in ide/segger.cmake]

Set compile definitions for Segger Embedded Studio (SES)

This function sets compile definitions for the SES interface library. It accepts one or more preprocessor definitions as arguments. These definitions are added with INTERFACE visibility, meaning they will be applied to any target that links against the SES interface library.

Example:

sdk_ses_compile_definitions(-DDEBUG -DVERSION=1)

Param def:

Compiler preprocessing definitions to be added with INTERFACE visibility.

sdk_ses_compile_options

sdk_ses_compile_options()

[function defined in ide/segger.cmake]

Set compile options for Segger Embedded Studio (SES)

This function sets compile options for the SES interface library. It accepts one or more compile options as arguments. These options are added with INTERFACE visibility, meaning they will be applied to any target that links against the SES interface library.

Example:

sdk_ses_compile_options(-O2 -g)

Param opts:

Compile options to be added with INTERFACE visibility.

sdk_ses_inc

sdk_ses_inc()

[function defined in ide/segger.cmake]

Add include path for Segger Embedded Studio (SES)

This function adds include directories to the SES interface library. It accepts one or more include directory paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory.

Example:

sdk_ses_inc(include)

Param inc:

Include directories to be added with INTERFACE visibility.

sdk_ses_opt_debug_connection

sdk_ses_opt_debug_connection(conn)

[function defined in ide/segger.cmake]

Set debug connection for Segger Embedded Studio (SES)

This function sets the debug connection option for the SES project.

Example:

sdk_ses_opt_debug_connection(“GDB Server”)

Param conn:

The debug connection type to set.

sdk_ses_opt_lib_io_type

sdk_ses_opt_lib_io_type(type)

[function defined in ide/segger.cmake]

Set library I/O type for Segger Embedded Studio (SES)

This function sets the library I/O type option for the SES project.

Example:

sdk_ses_opt_lib_io_type(STD)

Param type:

The library I/O type to set.

sdk_ses_options

sdk_ses_options()

[function defined in ide/segger.cmake]

Add options for Segger Embedded Studio (SES) project

This function adds options to the SES project configuration. It accepts a list of option key-value pairs, where each pair is split by a space.

Example:

sdk_ses_options(“option_a_name=option_a_value”)

Param option_key_value_list:

List of option key-value pairs for the SES project.

sdk_ses_set_bss_placement

sdk_ses_set_bss_placement(path, section_name)

[function defined in ide/segger.cmake]

Set BSS (Block Started by Symbol) section placement for Segger Embedded Studio (SES)

This function sets the BSS section placement for all configurations in the SES project. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_bss_placement(“path/to/file.c” “my_bss_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_bss_placement_debug

sdk_ses_set_bss_placement_debug(path, section_name)

[function defined in ide/segger.cmake]

Set BSS section placement for Debug configuration in Segger Embedded Studio (SES)

This function sets the BSS section placement specifically for the Debug configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_bss_placement_debug(“path/to/file.c” “my_bss_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_bss_placement_release

sdk_ses_set_bss_placement_release(path, section_name)

[function defined in ide/segger.cmake]

Set BSS section placement for Release configuration in Segger Embedded Studio (SES)

This function sets the BSS section placement specifically for the Release configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_bss_placement_release(“path/to/file.c” “my_bss_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_code_placement

sdk_ses_set_code_placement(path, section_name)

[function defined in ide/segger.cmake]

Set code section placement for Segger Embedded Studio (SES)

This function sets the code section placement for all configurations in the SES project. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_code_placement(“path/to/file.c” “my_code_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_code_placement_debug

sdk_ses_set_code_placement_debug(path, section_name)

[function defined in ide/segger.cmake]

Set code section placement for Debug configuration in Segger Embedded Studio (SES)

This function sets the code section placement specifically for the Debug configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_code_placement_debug(“path/to/file.c” “my_code_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_code_placement_release

sdk_ses_set_code_placement_release(path, section_name)

[function defined in ide/segger.cmake]

Set code section placement for Release configuration in Segger Embedded Studio (SES)

This function sets the code section placement specifically for the Release configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_code_placement_release(“path/to/file.c” “my_code_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_const_placement

sdk_ses_set_const_placement(path, section_name)

[function defined in ide/segger.cmake]

Set const section placement for Segger Embedded Studio (SES)

This function sets the const section placement for all configurations in the SES project. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_const_placement(“path/to/file.c” “my_const_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_const_placement_debug

sdk_ses_set_const_placement_debug(path, section_name)

[function defined in ide/segger.cmake]

Set const section placement for Debug configuration in Segger Embedded Studio (SES)

This function sets the const section placement specifically for the Debug configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_const_placement_debug(“path/to/file.c” “my_const_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_const_placement_release

sdk_ses_set_const_placement_release(path, section_name)

[function defined in ide/segger.cmake]

Set const section placement for Release configuration in Segger Embedded Studio (SES)

This function sets the const section placement specifically for the Release configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_const_placement_release(“path/to/file.c” “my_const_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_data_placement

sdk_ses_set_data_placement(path, section_name)

[function defined in ide/segger.cmake]

Set data section placement for Segger Embedded Studio (SES)

This function sets the data section placement for all configurations in the SES project. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_data_placement(“path/to/file.c” “my_data_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_data_placement_debug

sdk_ses_set_data_placement_debug(path, section_name)

[function defined in ide/segger.cmake]

Set data section placement for Debug configuration in Segger Embedded Studio (SES)

This function sets the data section placement specifically for the Debug configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_data_placement_debug(“path/to/file.c” “my_data_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_data_placement_release

sdk_ses_set_data_placement_release(path, section_name)

[function defined in ide/segger.cmake]

Set data section placement for Release configuration in Segger Embedded Studio (SES)

This function sets the data section placement specifically for the Release configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_data_placement_release(“path/to/file.c” “my_data_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_isr_placement

sdk_ses_set_isr_placement(path, section_name)

[function defined in ide/segger.cmake]

Set ISR (Interrupt Service Routine) section placement for Segger Embedded Studio (SES)

This function sets the ISR section placement for all configurations in the SES project. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_isr_placement(“path/to/file.c” “my_isr_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_isr_placement_debug

sdk_ses_set_isr_placement_debug(path, section_name)

[function defined in ide/segger.cmake]

Set ISR section placement for Debug configuration in Segger Embedded Studio (SES)

This function sets the ISR section placement specifically for the Debug configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_isr_placement_debug(“path/to/file.c” “my_isr_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_isr_placement_release

sdk_ses_set_isr_placement_release(path, section_name)

[function defined in ide/segger.cmake]

Set ISR section placement for Release configuration in Segger Embedded Studio (SES)

This function sets the ISR section placement specifically for the Release configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_isr_placement_release(“path/to/file.c” “my_isr_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_optimization_level

sdk_ses_set_optimization_level(path, level)

[function defined in ide/segger.cmake]

Set optimization level for file or directory in Segger Embedded Studio (SES)

This function sets the optimization level for all configurations in the SES project. It is a convenience wrapper around __sdk_ses_set_optimization_level.

Example:

sdk_ses_set_optimization_level(“path/to/file.c” “Level 2 for speed”)

Param path:

Path to the source file or directory

Param level:

Optimization level to set

sdk_ses_set_optimization_level_debug

sdk_ses_set_optimization_level_debug(path, level)

[function defined in ide/segger.cmake]

Set optimization level for Debug configuration in Segger Embedded Studio (SES)

This function sets the optimization level specifically for the Debug configuration. It is a convenience wrapper around __sdk_ses_set_optimization_level.

Example:

sdk_ses_set_optimization_level_debug(“path/to/file.c” “Level 2 for speed”)

Param path:

Path to the source file or directory

Param level:

Optimization level to set

sdk_ses_set_optimization_level_release

sdk_ses_set_optimization_level_release(path, level)

[function defined in ide/segger.cmake]

Set optimization level for Release configuration in Segger Embedded Studio (SES)

This function sets the optimization level specifically for the Release configuration. It is a convenience wrapper around __sdk_ses_set_optimization_level.

Example:

sdk_ses_set_optimization_level_release(“path/to/file.c” “Level 2 for speed”)

Param path:

Path to the source file or directory

Param level:

Optimization level to set

sdk_ses_set_vector_placement

sdk_ses_set_vector_placement(path, section_name)

[function defined in ide/segger.cmake]

Set vector section placement for Segger Embedded Studio (SES)

This function sets the vector section placement for all configurations in the SES project. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_vector_placement(“path/to/file.c” “my_vector_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_vector_placement_debug

sdk_ses_set_vector_placement_debug(path, section_name)

[function defined in ide/segger.cmake]

Set vector section placement for Debug configuration in Segger Embedded Studio (SES)

This function sets the vector section placement specifically for the Debug configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_vector_placement_debug(“path/to/file.c” “my_vector_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_set_vector_placement_release

sdk_ses_set_vector_placement_release(path, section_name)

[function defined in ide/segger.cmake]

Set vector section placement for Release configuration in Segger Embedded Studio (SES)

This function sets the vector section placement specifically for the Release configuration. It is a convenience wrapper around sdk_ses_set_section_placement.

Example:

sdk_ses_set_vector_placement_release(“path/to/file.c” “my_vector_section”)

Param path:

Path to the source file or directory

Param section_name:

Name of the section to place

sdk_ses_src

sdk_ses_src()

[function defined in ide/segger.cmake]

Add source file for Segger Embedded Studio (SES)

This function adds source files to the SES library. It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_ses_src(source_file.c)

Param SOURCE_FILE:

Source files to be added to the SES library.

sdk_ses_src_glob

sdk_ses_src_glob()

[function defined in ide/segger.cmake]

Add source file (glob pattern) for Segger Embedded Studio (SES)

This function adds source files to the SES library using a glob pattern. It accepts one or more glob patterns as arguments. The files matching the patterns are added to the SES library.

Example:

sdk_ses_src_glob(“src/**/*.c”)

Param SOURCE_FILE_GLOB:

Glob patterns to specify source files to be added to SES.

sdk_ses_startup_src

sdk_ses_startup_src()

[function defined in ide/segger.cmake]

Add source file for Segger Embedded Studio (SES) startup

This function adds source files to the SES startup library. It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_ses_startup_src(startup_file.c)

Param STARTUP_SOURCE_FILE:

Source files to be added to the SES startup library.

sdk_src

sdk_src()

[function defined in cmake-ext.cmake]

Add source file to sdk core (HPM_SDK_LIB)

This function adds source files to the HPM SDK core library (HPM_SDK_LIB). It accepts one or more source file paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. Directories cannot be added as source files.

Example:

sdk_src(SOURCE_FILE) sdk_src(file1.c file2.c) sdk_src(${PROJECT_SOURCE_DIR}/src/file.c)

Param SOURCE_FILE:

source files to be added to HPM_SDK_LIB

sdk_src_glob

sdk_src_glob()

[function defined in cmake-ext.cmake]

Add source files (glob pattern) to the SDK core (HPM_SDK_LIB)

This function adds source files to the HPM SDK core library (HPM_SDK_LIB) using a glob pattern. It accepts one or more glob patterns as arguments. The files matching the patterns are added to the SDK core library.

Example:

sdk_src_glob(“src/**/*.c”)

Param SOURCE_FILE_GLOB:

Glob patterns to specify source files to be added to HPM_SDK_LIB, such as “src/**/*.c” to add all .c files under the src directory recursively.

sdk_src_glob_ifdef

sdk_src_glob_ifdef(feature)

[function defined in cmake-ext.cmake]

Add source files (glob pattern) for SDK core if a feature is enabled

This function adds source files to the SDK core library using a glob pattern, but only if a specified feature is enabled. It accepts a feature flag and one or more glob patterns as arguments. The files matching the patterns are added if the feature is enabled.

Example:

sdk_src_glob_ifdef(FEATURE_X “src/**/*.c”)

Param feature:

The feature flag to check.

Param SOURCE_FILE_GLOB:

Glob patterns to specify source files to be added to HPM_SDK_LIB, such as “src/**/*.c” to add all .c files under the src directory recursively.

sdk_src_glob_ifndef

sdk_src_glob_ifndef(feature)

[function defined in cmake-ext.cmake]

Add source files (glob pattern) for SDK core if a feature is not enabled

This function adds source files to the SDK core library using a glob pattern, but only if a specified feature is not enabled. It accepts a feature flag and one or more glob patterns as arguments. The files matching the patterns are added if the feature is not enabled.

Example:

sdk_src_glob_ifndef(FEATURE_Y “src/**/*.c”)

Param feature:

The feature flag to check.

Param SOURCE_FILE_GLOB:

Glob patterns to specify source files to be added to HPM_SDK_LIB, such as “src/**/*.c” to add all .c files under the src directory recursively.

sdk_src_ifdef

sdk_src_ifdef(feature)

[function defined in cmake-ext.cmake]

Add source files to the SDK core if a feature is enabled

This function adds source files to the SDK core library if a specified feature is enabled. It takes a feature flag and a list of source files to add. If the feature is enabled, each file in the list is added using sdk_src.

Example:

sdk_src_ifdef(FEATURE_A file1.c file2.c)

Param feature:

The feature flag to check.

Param ARGN:

The list of source files to add.

sdk_src_ifndef

sdk_src_ifndef(feature)

[function defined in cmake-ext.cmake]

Add source files to the SDK core if a feature is not enabled

This function adds source files to the SDK core library if a specified feature is not enabled. It takes a feature flag and a list of source files to add. If the feature is not defined or is set to 0, each file in the list is added using sdk_src.

Example:

sdk_src_ifndef(FEATURE_B file3.c file4.c)

Param feature:

The feature flag to check.

Param ARGN:

The list of source files to add.

sdk_sys_inc

sdk_sys_inc()

[function defined in cmake-ext.cmake]

Add system include path

This function adds system include directories to the HPM SDK interface library (HPM_SDK_LIB_ITF). It accepts one or more include directory paths as arguments. If a relative path is provided, it will be resolved relative to the current source directory. The include paths are added with SYSTEM INTERFACE visibility, indicating that they are system include paths and will be propagated to targets that link against the HPM_SDK_LIB_ITF target. This can be useful for suppressing warnings from third-party headers.

Example:

sdk_sys_inc(SYS_INC_PATH) sdk_sys_inc(system_include) sdk_sys_inc(system_include1 system_include2) sdk_sys_inc(${PROJECT_SOURCE_DIR}/system_include)

Param SYS_INC_PATH:

system include directories to be added with SYSTEM INTERFACE visibility

sdk_zcc_compile_definitions

sdk_zcc_compile_definitions()

[function defined in cmake-ext.cmake]

Set compile definitions for ZCC toolchain

This function sets compile definitions for the ZCC toolchain by adding them with INTERFACE visibility to the HPM_SDK_ZCC_LIB_ITF target. This ensures that the definitions are applied to any target that links against the ZCC toolchain interface library.

Example:

sdk_zcc_compile_definitions(-DDEBUG -DVERSION=1)

Param defs:

Definitions for the ZCC toolchain to be added with INTERFACE visibility.

sdk_zcc_compile_options

sdk_zcc_compile_options()

[function defined in cmake-ext.cmake]

Set compile options for ZCC toolchain

This function sets compile options for the ZCC toolchain by adding them with INTERFACE visibility to the HPM_SDK_ZCC_LIB_ITF target. This ensures that the options are applied to any target that links against the ZCC toolchain interface library.

Example:

sdk_zcc_compile_options(-O2 -g)

Param opts:

Options for the ZCC toolchain to be added with INTERFACE visibility.

sdk_zcc_ld_options

sdk_zcc_ld_options()

[function defined in cmake-ext.cmake]

Set linker options for ZCC toolchains

This function sets linker options for the ZCC toolchain by adding them with INTERFACE visibility to the HPM_SDK_ZCC_LIB_ITF target. This ensures that the options are applied to any target that links against the ZCC toolchain interface library.

Example:

sdk_zcc_ld_options(-Wl,–start-group -Wl,–end-group)

Param opts:

Linker options to be added with INTERFACE visibility.