Skip to content

Commit

Permalink
cmake: modules: extensions: Rename prefix in functions
Browse files Browse the repository at this point in the history
Renames a prefix in a function to avoid clashes with global variable
that have the same name

(cherry picked from commit 5841c11)

Original-Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
GitOrigin-RevId: 5841c11
Change-Id: Iffe21f5367a0242e0d968d0672f097be0ec16ebb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5466616
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
  • Loading branch information
nordicjm authored and Chromeos LUCI committed Apr 18, 2024
1 parent f8723e9 commit 45f3424
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmake/modules/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2865,9 +2865,9 @@ endfunction()
#
function(zephyr_file_suffix filename)
set(single_args SUFFIX)
cmake_parse_arguments(FILE "" "${single_args}" "" ${ARGN})
cmake_parse_arguments(SFILE "" "${single_args}" "" ${ARGN})

if(NOT DEFINED FILE_SUFFIX OR NOT DEFINED ${filename})
if(NOT DEFINED SFILE_SUFFIX OR NOT DEFINED ${filename})
# If the file suffix variable is not known then there is nothing to do, return early
return()
endif()
Expand All @@ -2883,7 +2883,7 @@ function(zephyr_file_suffix filename)
# Search for the full stop so we know where to add the file suffix before the file extension
cmake_path(GET file EXTENSION file_ext)
cmake_path(REMOVE_EXTENSION file OUTPUT_VARIABLE new_filename)
cmake_path(APPEND_STRING new_filename "_${FILE_SUFFIX}${file_ext}")
cmake_path(APPEND_STRING new_filename "_${SFILE_SUFFIX}${file_ext}")

# Use the filename with the suffix if it exists, if not then fall back to the default
if(EXISTS "${new_filename}")
Expand Down

0 comments on commit 45f3424

Please sign in to comment.