Skip to content

Commit d1b91b7

Browse files
committed
Merge branch 'fix/cmakev2_fixes' into 'master'
fix(cmakev2): sync with cmakev1 changes See merge request espressif/esp-idf!43095
2 parents 70b28a8 + 999cc27 commit d1b91b7

File tree

4 files changed

+47
-11
lines changed

4 files changed

+47
-11
lines changed

Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
729729

730730
endmenu
731731

732-
menu "Configuration for components not included in the build"
732+
menu "Project configuration for components not included in the build"
733733
depends on "${IDF_BUILD_V2}"
734734
osource "$COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE"
735735
endmenu

tools/cmakev2/compat.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,11 @@ function(__init_common_components)
258258
# Define common components that are included as dependencies for each
259259
# component.
260260
if("${idf_target}" STREQUAL "linux")
261-
set(requires_common freertos esp_hw_support heap log soc hal esp_rom esp_common esp_system linux)
261+
set(requires_common freertos esp_hw_support heap log soc hal esp_rom esp_common esp_system linux
262+
esp_stdio)
262263
else()
263264
set(requires_common cxx esp_libc freertos esp_hw_support heap log soc hal esp_rom esp_common
264-
esp_system ${idf_target_arch})
265+
esp_system esp_stdio ${idf_target_arch})
265266
endif()
266267
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${requires_common}")
267268

tools/cmakev2/project.cmake

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function(__init_project_configuration)
128128
if(IDF_TARGET STREQUAL "linux")
129129
# Building for Linux target, fall back to an older version of the standard
130130
# if the preferred one is not supported by the compiler.
131-
set(preferred_c_versions gnu17 gnu11 gnu99)
131+
set(preferred_c_versions gnu23 gnu17 gnu11 gnu99)
132132
set(ver_found FALSE)
133133
foreach(c_version ${preferred_c_versions})
134134
check_c_compiler_flag("-std=${c_version}" ver_${c_version}_supported)
@@ -143,7 +143,7 @@ function(__init_project_configuration)
143143
"${preferred_c_versions}. Please upgrade the host compiler.")
144144
endif()
145145

146-
set(preferred_cxx_versions gnu++2b gnu++20 gnu++2a gnu++17 gnu++14)
146+
set(preferred_cxx_versions gnu++26 gnu++2b gnu++20 gnu++2a gnu++17 gnu++14)
147147
set(ver_found FALSE)
148148
foreach(cxx_version ${preferred_cxx_versions})
149149
check_cxx_compiler_flag("-std=${cxx_version}" ver_${cxx_version}_supported)
@@ -167,8 +167,8 @@ function(__init_project_configuration)
167167
# function, which must be called after project().
168168
# Please update docs/en/api-guides/c.rst, docs/en/api-guides/cplusplus.rst and
169169
# tools/test_apps/system/cxx_build_test/main/test_cxx_standard.cpp when changing this.
170-
list(APPEND c_compile_options "-std=gnu17")
171-
list(APPEND cxx_compile_options "-std=gnu++2b")
170+
list(APPEND c_compile_options "-std=gnu23")
171+
list(APPEND cxx_compile_options "-std=gnu++26")
172172
endif()
173173

174174
if(CONFIG_COMPILER_OPTIMIZATION_SIZE)
@@ -472,13 +472,10 @@ function(__init_project_configuration)
472472
get_filename_component(compiler_sysroot "${compiler_sysroot}/.." REALPATH)
473473
list(APPEND compile_options "-fdebug-prefix-map=${compiler_sysroot}=/TOOLCHAIN")
474474
string(APPEND gdbinit_file_lines "set substitute-path /TOOLCHAIN ${compiler_sysroot}\n")
475-
476-
file(WRITE "${build_dir}/prefix_map_gdbinit" "${gdbinit_file_lines}") # TODO IDF-11667
477-
idf_build_set_property(DEBUG_PREFIX_MAP_GDBINIT "${gdbinit_path}")
478475
else()
479476
set(gdbinit_file_lines "# There is no prefix map defined for the project.\n")
480477
endif()
481-
# Write prefix_map_gdbinit file even it is empty.
478+
# Write the prefix_map file even if it is empty.
482479
file(MAKE_DIRECTORY ${gdbinit_dir})
483480
file(WRITE "${gdbinit_path}" "${gdbinit_file_lines}")
484481

@@ -571,6 +568,10 @@ macro(idf_project_init)
571568
# Ensure this function is executed only once throughout the entire
572569
# project.
573570

571+
# Warn about the use of deprecated variables.
572+
deprecate_variable(COMPONENTS)
573+
deprecate_variable(EXCLUDE_COMPONENTS)
574+
574575
# Set PROJECT_NAME build property
575576
__init_project_name()
576577

tools/cmakev2/utilities.cmake

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,40 @@ function(idf_dbg)
109109
message(DEBUG " IDF: ${joined}")
110110
endfunction()
111111

112+
#[[
113+
idf_deprecated(<msg>...)
114+
115+
*msg[in]*
116+
117+
Message to print.
118+
119+
Print deprecated ``<msg>``. Multiple messages are concatenated into a
120+
single message with no separator between them.
121+
#]]
122+
function(idf_deprecated)
123+
set(joined "")
124+
math(EXPR last "${ARGC} - 1")
125+
foreach(i RANGE 0 ${last})
126+
string(APPEND joined "${ARGV${i}}")
127+
endforeach()
128+
message(DEPRECATION " IDF: ${joined}")
129+
endfunction()
130+
131+
#[[
132+
deprecate_variable(<var>)
133+
134+
*var[in]*
135+
136+
Deprecated variable name.
137+
138+
Print a warning about the use of a deprecated variable.
139+
#]]
140+
function(deprecate_variable var)
141+
if(${var})
142+
idf_deprecated("The use of the '${var}' variable is deprecated and will be ignored.")
143+
endif()
144+
endfunction()
145+
112146
#[[
113147
__get_real_target(TARGET <target>
114148
OUTPUT <variable>)

0 commit comments

Comments
 (0)