From 763a49f082171499442eed6b617f78f33c4e42a5 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 28 Jan 2025 12:02:52 +0000 Subject: [PATCH] cmake: Remove build type Build type was deprecated in Zephyr 3.6, it was replaced with FILE_SUFFIX support Signed-off-by: Jamie McCrae --- cmake/modules/configuration_files.cmake | 4 --- cmake/modules/extensions.cmake | 46 ++++++------------------- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/cmake/modules/configuration_files.cmake b/cmake/modules/configuration_files.cmake index ff7a172445c..fe1ff3bf16f 100644 --- a/cmake/modules/configuration_files.cmake +++ b/cmake/modules/configuration_files.cmake @@ -47,10 +47,6 @@ else() if(${CONF_FILE_LENGTH} EQUAL 1) get_filename_component(CONF_FILE_NAME ${CONF_FILE} NAME) if(${CONF_FILE_NAME} MATCHES "prj_(.*).conf") - set(CONF_FILE_BUILD_TYPE ${CMAKE_MATCH_1}) - zephyr_file(CONF_FILES ${APPLICATION_CONFIG_DIR}/boards KCONF CONF_FILE - BUILD ${CONF_FILE_BUILD_TYPE} - ) set(CONF_FILE_FORCE_CACHE FORCE) endif() endif() diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index d425253a555..7c94b5131be 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -1602,8 +1602,6 @@ endfunction() # - Build string with cpuset removed in addition # - Build string with soc removed in addition # -# If BUILD is supplied, then build type will be appended to each entry in the -# list above. # If REVISION is supplied or obtained as system wide setting a build string # with the sanitized revision string will be added in addition to the # non-revisioned entry for each entry. @@ -1614,12 +1612,10 @@ endfunction() # [SHORT ] # [BOARD_QUALIFIERS ] # [BOARD_REVISION ] -# [BUILD ] # [MERGE [REVERSE]] # ) # zephyr_build_string( # BOARD_QUALIFIERS -# [BUILD ] # [MERGE [REVERSE]] # ) # @@ -1627,18 +1623,17 @@ endfunction() # SHORT : Output variable where the shortened build string will be returned. # BOARD : Board name to use when creating the build string. # BOARD_REVISION : Board revision to use when creating the build string. -# BUILD : Build type to use when creating the build string. # MERGE: Return a list of build strings instead of a single build string. # REVERSE: Reverse the list before returning it. # # Examples # calling -# zephyr_build_string(build_string BOARD alpha BUILD debug) -# will return the string `alpha_debug` in `build_string` parameter. +# zephyr_build_string(build_string BOARD alpha) +# will return the string `alpha` in `build_string` parameter. # # calling -# zephyr_build_string(build_string BOARD alpha BOARD_REVISION 1.0.0 BUILD debug) -# will return the string `alpha_1_0_0_debug` in `build_string` parameter. +# zephyr_build_string(build_string BOARD alpha BOARD_REVISION 1.0.0) +# will return the string `alpha_1_0_0` in `build_string` parameter. # # calling # zephyr_build_string(build_string BOARD alpha BOARD_QUALIFIERS /soc/bar) @@ -1661,7 +1656,7 @@ endfunction() # function(zephyr_build_string outvar) set(options MERGE REVERSE) - set(single_args BOARD BOARD_QUALIFIERS BOARD_REVISION BUILD SHORT) + set(single_args BOARD BOARD_QUALIFIERS BOARD_REVISION SHORT) cmake_parse_arguments(BUILD_STR "${options}" "${single_args}" "" ${ARGN}) if(BUILD_STR_UNPARSED_ARGUMENTS) @@ -1695,10 +1690,10 @@ function(zephyr_build_string outvar) string(REPLACE "/" ";" str_segment_list "${BUILD_STR_BOARD_QUALIFIERS}") string(REPLACE "." "_" revision_string "${BUILD_STR_BOARD_REVISION}") - string(JOIN "_" ${outvar} ${BUILD_STR_BOARD} ${str_segment_list} ${revision_string} ${BUILD_STR_BUILD}) + string(JOIN "_" ${outvar} ${BUILD_STR_BOARD} ${str_segment_list} ${revision_string}) if(BUILD_STR_MERGE) - string(JOIN "_" variant_string ${BUILD_STR_BOARD} ${str_segment_list} ${BUILD_STR_BUILD}) + string(JOIN "_" variant_string ${BUILD_STR_BOARD} ${str_segment_list}) if(NOT "${variant_string}" IN_LIST ${outvar}) list(APPEND ${outvar} "${variant_string}") @@ -1714,10 +1709,10 @@ function(zephyr_build_string outvar) string(REGEX REPLACE "^/[^/]*(.*)" "\\1" shortened_qualifiers "${BOARD_QUALIFIERS}") string(REPLACE "/" ";" str_short_segment_list "${shortened_qualifiers}") string(JOIN "_" ${BUILD_STR_SHORT} - ${BUILD_STR_BOARD} ${str_short_segment_list} ${revision_string} ${BUILD_STR_BUILD} + ${BUILD_STR_BOARD} ${str_short_segment_list} ${revision_string} ) if(BUILD_STR_MERGE) - string(JOIN "_" variant_string ${BUILD_STR_BOARD} ${str_short_segment_list} ${BUILD_STR_BUILD}) + string(JOIN "_" variant_string ${BUILD_STR_BOARD} ${str_short_segment_list}) if(NOT "${variant_string}" IN_LIST ${BUILD_STR_SHORT}) list(APPEND ${BUILD_STR_SHORT} "${variant_string}") @@ -2663,7 +2658,7 @@ endfunction() # Usage: # zephyr_file(CONF_FILES [DTS ] [KCONF ] # [BOARD [BOARD_REVISION ] | NAMES ...] -# [BUILD ] [SUFFIX ] [REQUIRED] +# [SUFFIX ] [REQUIRED] # ) # # CONF_FILES : Find all configuration files in the list of paths and @@ -2690,10 +2685,6 @@ endfunction() # DTS : List to append DTS overlay files in to # KCONF : List to append Kconfig fragment files in to # DEFCONF : List to append _defconfig files in to -# BUILD : Build type to include for search. -# For example: -# BUILD debug, will look for _debug.conf -# and _debug.overlay, instead of .conf # SUFFIX : Suffix name to check for instead of the default name # but with a fallback to the default name if not found. # For example: @@ -2713,7 +2704,7 @@ Please provide one of following: APPLICATION_ROOT, CONF_FILES") set(single_args APPLICATION_ROOT BASE_DIR) elseif(${ARGV0} STREQUAL CONF_FILES) set(options QUALIFIERS REQUIRED) - set(single_args BOARD BOARD_REVISION BOARD_QUALIFIERS DTS KCONF DEFCONFIG BUILD SUFFIX) + set(single_args BOARD BOARD_REVISION BOARD_QUALIFIERS DTS KCONF DEFCONFIG SUFFIX) set(multi_args CONF_FILES NAMES) endif() @@ -2792,13 +2783,11 @@ Relative paths are only allowed with `-D${ARGV1}=`") BOARD ${ZFILE_BOARD} BOARD_REVISION ${ZFILE_BOARD_REVISION} BOARD_QUALIFIERS ${ZFILE_BOARD_QUALIFIERS} - BUILD ${ZFILE_BUILD} MERGE REVERSE ) else() zephyr_build_string(filename_list BOARD_QUALIFIERS ${ZFILE_BOARD_QUALIFIERS} - BUILD ${ZFILE_BUILD} MERGE REVERSE ) endif() @@ -2834,10 +2823,6 @@ Relative paths are only allowed with `-D${ARGV1}=`") list(APPEND found_dts_files ${test_file_0}) list(APPEND found_dts_files ${test_file_1}) - if(DEFINED ZFILE_BUILD) - set(deprecated_file_found y) - endif() - if(ZFILE_NAMES) break() endif() @@ -2885,10 +2870,6 @@ Relative paths are only allowed with `-D${ARGV1}=`") list(APPEND found_conf_files ${test_file_0}) list(APPEND found_conf_files ${test_file_1}) - if(DEFINED ZFILE_BUILD) - set(deprecated_file_found y) - endif() - if(ZFILE_NAMES) break() endif() @@ -2926,11 +2907,6 @@ Relative paths are only allowed with `-D${ARGV1}=`") ) endif() - if(deprecated_file_found) - message(DEPRECATION "prj_.conf was deprecated after Zephyr 3.5," - " you should switch to using -DFILE_SUFFIX instead") - endif() - if(ZFILE_DEFCONFIG) set(found_defconf_files) foreach(path ${ZFILE_CONF_FILES})