Skip to content

Commit 69d2c0f

Browse files
tejlmandcarlescufi
authored andcommitted
cmake: add toolchain_ld_<name> macros to FindDeprecated
Follow-up: #77887 The macros: - toolchain_ld_base - toolchain_ld_baremetal - toolchain_ld_cpp was deprecated in 5db1f1a but no check was added to FindDeprecated.cmake, meaning toolchains still providing those macros was not getting a proper deprecation warning. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 14a72b5 commit 69d2c0f

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

cmake/modules/FindDeprecated.cmake

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,54 @@ if("PYTHON_PREFER" IN_LIST Deprecated_FIND_COMPONENTS)
9999
endif()
100100
endif()
101101

102+
if("toolchain_ld_base" IN_LIST Deprecated_FIND_COMPONENTS)
103+
# This code was deprecated after Zephyr v4.0.0
104+
list(REMOVE_ITEM Deprecated_FIND_COMPONENTS toolchain_ld_base)
105+
106+
if(COMMAND toolchain_ld_base)
107+
message(DEPRECATION
108+
"The macro/function 'toolchain_ld_base' is deprecated. "
109+
"Please use '${LINKER}/linker_flags.cmake' and define the appropriate "
110+
"linker flags as properties instead. "
111+
"See '${ZEPHYR_BASE}/cmake/linker/linker_flags_template.cmake' for "
112+
"known linker properties."
113+
)
114+
toolchain_ld_base()
115+
endif()
116+
endif()
117+
118+
if("toolchain_ld_baremetal" IN_LIST Deprecated_FIND_COMPONENTS)
119+
# This code was deprecated after Zephyr v4.0.0
120+
list(REMOVE_ITEM Deprecated_FIND_COMPONENTS toolchain_ld_baremetal)
121+
122+
if(COMMAND toolchain_ld_baremetal)
123+
message(DEPRECATION
124+
"The macro/function 'toolchain_ld_baremetal' is deprecated. "
125+
"Please use '${LINKER}/linker_flags.cmake' and define the appropriate "
126+
"linker flags as properties instead. "
127+
"See '${ZEPHYR_BASE}/cmake/linker/linker_flags_template.cmake' for "
128+
"known linker properties."
129+
)
130+
toolchain_ld_baremetal()
131+
endif()
132+
endif()
133+
134+
if("toolchain_ld_cpp" IN_LIST Deprecated_FIND_COMPONENTS)
135+
# This code was deprecated after Zephyr v4.0.0
136+
list(REMOVE_ITEM Deprecated_FIND_COMPONENTS toolchain_ld_cpp)
137+
138+
if(COMMAND toolchain_ld_cpp)
139+
message(DEPRECATION
140+
"The macro/function 'toolchain_ld_cpp' is deprecated. "
141+
"Please use '${LINKER}/linker_flags.cmake' and define the appropriate "
142+
"linker flags as properties instead. "
143+
"See '${ZEPHYR_BASE}/cmake/linker/linker_flags_template.cmake' for "
144+
"known linker properties."
145+
)
146+
toolchain_ld_cpp()
147+
endif()
148+
endif()
149+
102150
if(NOT "${Deprecated_FIND_COMPONENTS}" STREQUAL "")
103151
message(STATUS "The following deprecated component(s) could not be found: "
104152
"${Deprecated_FIND_COMPONENTS}")

0 commit comments

Comments
 (0)