@@ -11,6 +11,8 @@ endif()
1111# TARGET that match either an optionally specified list of source files or all the target's "SOURCES" found
1212# within in the target's "SOURCE_DIR".
1313#
14+ # This utility function is only available in builds using CMake 3.27 and later.
15+ #
1416# Examples:
1517# pico_sections_time_critical(MyTarget)
1618#
@@ -22,6 +24,8 @@ endif()
2224# \param\ TARGET The build target
2325# \param\ SOURCES Optional, source files of the object files to be modified. If not specified, uses the build
2426# target's "SOURCES" list.
27+ #
28+ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.27)
2529function (pico_sections_time_critical TARGET )
2630 add_custom_command (
2731 TARGET ${TARGET}
@@ -33,6 +37,7 @@ function(pico_sections_time_critical TARGET)
3337 COMMAND_EXPAND_LISTS
3438 )
3539endfunction ()
40+ endif ()
3641
3742# pico_sections_not_in_flash(TARGET [SOURCES])
3843# \brief\ Prefix target's object file sections with ".time_critical_ram"
@@ -41,6 +46,8 @@ endfunction()
4146# TARGET that match either an optionally specified list of source files or all the target's "SOURCES" found
4247# within in the target's "SOURCE_DIR".
4348#
49+ # This utility function is only available in builds using CMake 3.27 and later.
50+ #
4451# Examples:
4552# pico_sections_not_in_flash(MyTarget)
4653#
@@ -52,6 +59,7 @@ endfunction()
5259# \param\ TARGET The build target
5360# \param\ SOURCES Optional, source files of the object files to be modified. If not specified, uses the build
5461# target's "SOURCES" list.
62+ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.27)
5563function (pico_sections_not_in_flash TARGET )
5664 add_custom_command (
5765 TARGET ${TARGET}
@@ -63,3 +71,4 @@ function(pico_sections_not_in_flash TARGET)
6371 COMMAND_EXPAND_LISTS
6472 )
6573endfunction ()
74+ endif ()
0 commit comments