.. _cmake_intro: SDK CMake API Reference ============================= This page was auto-generated from cmake source files using generate_cmake_rst.py .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. !!!!!! Auto-generated file, do not modify .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. contents:: :local: Public CMake functions / macros ------------------------------- * :cmake:command:`add_subdirectory_ifdef` * :cmake:command:`add_subdirectory_ifndef` * :cmake:command:`generate_iar_project` * :cmake:command:`generate_ses_project` * :cmake:command:`sdk_app_inc` * :cmake:command:`sdk_app_src` * :cmake:command:`sdk_app_src_glob` * :cmake:command:`sdk_clear_compile_options` * :cmake:command:`sdk_compile_definitions` * :cmake:command:`sdk_compile_definitions_ifdef` * :cmake:command:`sdk_compile_options` * :cmake:command:`sdk_gcc_inc` * :cmake:command:`sdk_gcc_src` * :cmake:command:`sdk_gcc_src_glob` * :cmake:command:`sdk_gcc_startup_src` * :cmake:command:`sdk_get_compile_options` * :cmake:command:`sdk_iar_asm_preinclude` * :cmake:command:`sdk_iar_cc_preinclude` * :cmake:command:`sdk_iar_compile_definitions` * :cmake:command:`sdk_iar_compile_options` * :cmake:command:`sdk_iar_enable_andesperf` * :cmake:command:`sdk_iar_enable_dsp` * :cmake:command:`sdk_iar_enable_no_size_constraints` * :cmake:command:`sdk_iar_inc` * :cmake:command:`sdk_iar_link_libraries` * :cmake:command:`sdk_iar_src` * :cmake:command:`sdk_iar_src_glob` * :cmake:command:`sdk_iar_startup_src` * :cmake:command:`sdk_inc` * :cmake:command:`sdk_inc_ifdef` * :cmake:command:`sdk_inc_ifndef` * :cmake:command:`sdk_ld_options` * :cmake:command:`sdk_ld_options_ifdef` * :cmake:command:`sdk_link_libraries` * :cmake:command:`sdk_link_libraries_ifdef` * :cmake:command:`sdk_linker_global_symbols` * :cmake:command:`sdk_nds_compile_definitions` * :cmake:command:`sdk_nds_compile_options` * :cmake:command:`sdk_nds_ld_options` * :cmake:command:`sdk_nds_link_libraries` * :cmake:command:`sdk_raise_fatal_error_if_all_invalid` * :cmake:command:`sdk_raise_fatal_error_if_all_valid` * :cmake:command:`sdk_raise_fatal_error_if_valid_at_least_one` * :cmake:command:`sdk_ses_compile_definitions` * :cmake:command:`sdk_ses_compile_options` * :cmake:command:`sdk_ses_inc` * :cmake:command:`sdk_ses_link_libraries` * :cmake:command:`sdk_ses_opt_debug_connection` * :cmake:command:`sdk_ses_opt_debug_jlink_speed` * :cmake:command:`sdk_ses_opt_lib_io_type` * :cmake:command:`sdk_ses_options` * :cmake:command:`sdk_ses_set_bss_placement` * :cmake:command:`sdk_ses_set_bss_placement_debug` * :cmake:command:`sdk_ses_set_bss_placement_release` * :cmake:command:`sdk_ses_set_code_placement` * :cmake:command:`sdk_ses_set_code_placement_debug` * :cmake:command:`sdk_ses_set_code_placement_release` * :cmake:command:`sdk_ses_set_const_placement` * :cmake:command:`sdk_ses_set_const_placement_debug` * :cmake:command:`sdk_ses_set_const_placement_release` * :cmake:command:`sdk_ses_set_data_placement` * :cmake:command:`sdk_ses_set_data_placement_debug` * :cmake:command:`sdk_ses_set_data_placement_release` * :cmake:command:`sdk_ses_set_isr_placement` * :cmake:command:`sdk_ses_set_isr_placement_debug` * :cmake:command:`sdk_ses_set_isr_placement_release` * :cmake:command:`sdk_ses_set_optimization_level` * :cmake:command:`sdk_ses_set_optimization_level_debug` * :cmake:command:`sdk_ses_set_optimization_level_release` * :cmake:command:`sdk_ses_set_vector_placement` * :cmake:command:`sdk_ses_set_vector_placement_debug` * :cmake:command:`sdk_ses_set_vector_placement_release` * :cmake:command:`sdk_ses_src` * :cmake:command:`sdk_ses_src_glob` * :cmake:command:`sdk_ses_startup_src` * :cmake:command:`sdk_src` * :cmake:command:`sdk_src_glob` * :cmake:command:`sdk_src_glob_ifdef` * :cmake:command:`sdk_src_glob_ifndef` * :cmake:command:`sdk_src_ifdef` * :cmake:command:`sdk_src_ifndef` * :cmake:command:`sdk_sys_inc` * :cmake:command:`sdk_zcc_compile_definitions` * :cmake:command:`sdk_zcc_compile_options` * :cmake:command:`sdk_zcc_ld_options` * :cmake:command:`sdk_zcc_link_libraries` .. _`add_subdirectory_ifdef_ref`: `add_subdirectory_ifdef` ~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `add_subdirectory_ifndef` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `generate_iar_project` ~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ses_project_ref`: `generate_ses_project` ~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_app_inc` ~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_app_src` ~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_app_src_glob` ~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_clear_compile_options_ref`: `sdk_clear_compile_options` ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_compile_definitions` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_compile_definitions_ifdef` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_compile_options` ~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_gcc_inc` ~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_gcc_src` ~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_gcc_src_glob` ~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_gcc_startup_src` ~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_get_compile_options` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_asm_preinclude` ~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_cc_preinclude` ~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_compile_definitions` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_compile_options` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_enable_andesperf` ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_enable_dsp` ~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_enable_no_size_constraints` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_inc` ~~~~~~~~~~~~~ .. cmake:command:: 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_link_libraries_ref`: `sdk_iar_link_libraries` ~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: sdk_iar_link_libraries() *[function defined in ide/iar.cmake]* Link libraries for IAR This function links libraries to the IAR interface library. It accepts one or more library names or paths as arguments. The libraries can be actual file paths or standard libraries provided by the toolchain. Example: sdk_iar_link_libraries(libm) :param libs: Libraries to be linked with INTERFACE visibility. .. _`sdk_iar_src_ref`: `sdk_iar_src` ~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_src_glob` ~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_iar_startup_src` ~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_inc` ~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_inc_ifdef` ~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_inc_ifndef` ~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ld_options` ~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ld_options_ifdef` ~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_link_libraries_ref`: `sdk_link_libraries` ~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: sdk_link_libraries() *[function defined in cmake-ext.cmake]* Link libraries This function links libraries to the HPM SDK interface library (HPM_SDK_LIB_ITF). It accepts one or more library names or paths as arguments. The libraries can be actual file paths (e.g., USER_LIB.a) or standard libraries provided by the toolchain (e.g., m). If a library path is relative, it will be resolved relative to the current source directory. This function ensures that the specified libraries are linked with INTERFACE visibility, meaning they will be linked to any target that links against the HPM_SDK_LIB_ITF target. Example: sdk_link_libraries(libm) sdk_link_libraries(${PROJECT_SOURCE_DIR}/libs/libcustom.a) :param libs: libraries to be linked with INTERFACE visibility .. _`sdk_link_libraries_ifdef_ref`: `sdk_link_libraries_ifdef` ~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: sdk_link_libraries_ifdef(feature) *[function defined in cmake-ext.cmake]* Link libraries if feature is true This function links libraries to the HPM SDK interface library (HPM_SDK_LIB_ITF) only if a specified feature is enabled. It accepts one or more library names or paths as arguments. The libraries can be actual file paths (e.g., USER_LIB.a) or standard libraries provided by the toolchain (e.g., m). If a library path is relative, it will be resolved relative to the current source directory. This function ensures that the specified libraries are linked with INTERFACE visibility, meaning they will be linked to any target that links against the HPM_SDK_LIB_ITF target, but only if the feature flag is set. Example: sdk_link_libraries_ifdef(FEATURE_X libm) sdk_link_libraries_ifdef(FEATURE_Y ${PROJECT_SOURCE_DIR}/libs/libcustom.a) :param feature: the feature flag to check :param libs: libraries to be linked with INTERFACE visibility .. _`sdk_linker_global_symbols_ref`: `sdk_linker_global_symbols` ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_nds_compile_definitions` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_nds_compile_options` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_nds_ld_options` ~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_nds_link_libraries_ref`: `sdk_nds_link_libraries` ~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: sdk_nds_link_libraries() *[function defined in cmake-ext.cmake]* Link libraries for Andes toolchains This function links libraries for the Andes toolchain by adding them with INTERFACE visibility to the HPM_SDK_NDSGCC_LIB_ITF target. This ensures that the libraries are linked to any target that links against the Andes toolchain interface library. Example: sdk_nds_link_libraries(USER_LIB.a m) :param libs: Libraries to be linked, supporting both file paths (like USER_LIB.a) and standard libraries provided by the toolchain (like m). .. _`sdk_raise_fatal_error_if_all_invalid_ref`: `sdk_raise_fatal_error_if_all_invalid` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_raise_fatal_error_if_all_valid` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_raise_fatal_error_if_valid_at_least_one` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_compile_definitions` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_compile_options` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_inc` ~~~~~~~~~~~~~ .. cmake:command:: 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_link_libraries_ref`: `sdk_ses_link_libraries` ~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: sdk_ses_link_libraries() *[function defined in ide/segger.cmake]* Link libraries for Segger Embedded Studio (SES) This function links libraries to the SES interface library. It accepts one or more library names or paths as arguments. The libraries can be actual file paths or standard libraries provided by the toolchain. Example: sdk_ses_link_libraries(libm) :param libs: Libraries to be linked with INTERFACE visibility. .. _`sdk_ses_opt_debug_connection_ref`: `sdk_ses_opt_debug_connection` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_debug_jlink_speed_ref`: `sdk_ses_opt_debug_jlink_speed` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: sdk_ses_opt_debug_jlink_speed(speed) *[function defined in ide/segger.cmake]* Set J-Link speed for Segger Embedded Studio (SES) This function sets the J-Link speed option for the SES project. Example: sdk_ses_opt_debug_jlink_speed(4000) :param speed: The J-Link speed to set. .. _`sdk_ses_opt_lib_io_type_ref`: `sdk_ses_opt_lib_io_type` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_options` ~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_bss_placement` ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_bss_placement_debug` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_bss_placement_release` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_code_placement` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_code_placement_debug` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_code_placement_release` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_const_placement` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_const_placement_debug` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_const_placement_release` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_data_placement` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_data_placement_debug` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_data_placement_release` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_isr_placement` ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_isr_placement_debug` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_isr_placement_release` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_optimization_level` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_optimization_level_debug` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_optimization_level_release` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_vector_placement` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_vector_placement_debug` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_set_vector_placement_release` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_src` ~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_src_glob` ~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_ses_startup_src` ~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_src` ~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_src_glob` ~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_src_glob_ifdef` ~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_src_glob_ifndef` ~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_src_ifdef` ~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_src_ifndef` ~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_sys_inc` ~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_zcc_compile_definitions` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_zcc_compile_options` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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_ref`: `sdk_zcc_ld_options` ~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: 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. .. _`sdk_zcc_link_libraries_ref`: `sdk_zcc_link_libraries` ~~~~~~~~~~~~~~~~~~~~~~~~ .. cmake:command:: sdk_zcc_link_libraries() *[function defined in cmake-ext.cmake]* Link libraries for ZCC toolchains This function links libraries for the ZCC toolchain by adding them with INTERFACE visibility to the HPM_SDK_ZCC_LIB_ITF target. This ensures that the libraries are linked to any target that links against the ZCC toolchain interface library. Example: sdk_zcc_link_libraries(USER_LIB.a m) :param libs: Libraries to be linked, supporting both file paths (like USER_LIB.a) and standard libraries provided by the toolchain (like m).