@@ -59,41 +59,6 @@ set(compiler_args ${CMAKE_CXX_FLAGS})
5959separate_arguments (compiler_args)
6060list (FILTER compiler_args EXCLUDE REGEX "^$" )
6161
62- # Expand response files (arguments starting with @"filename")
63- # ESP-IDF's latest version uses response files for compiler flags
64- # These need to be expanded because meson cannot read them from its build context
65- function (expand_response_files arg_list output_var)
66- set (expanded_args)
67- foreach (arg IN LISTS arg_list)
68- # Check if argument is a response file reference: @"filename" or @filename
69- if (arg MATCHES "^@\" ?(.+)\" ?$" )
70- set (response_file "${CMAKE_MATCH_1} " )
71- # Remove quotes if present
72- string (REGEX REPLACE "^\" (.+)\" $" "\\ 1" response_file "${response_file} " )
73- # Check if file exists and read its contents
74- if (EXISTS "${response_file} " )
75- file (READ "${response_file} " file_contents)
76- # Split file contents into individual arguments
77- string (REGEX REPLACE "[\r\n ]+" ";" file_args "${file_contents} " )
78- separate_arguments (file_args)
79- list (FILTER file_args EXCLUDE REGEX "^$" )
80- list (APPEND expanded_args ${file_args} )
81- message (STATUS "Expanded response file ${response_file} with ${CMAKE_MATCH_0} arguments" )
82- else ()
83- # Response file doesn't exist yet (created at build time)
84- # Skip it - essential flags should be provided directly
85- message (STATUS "Skipping non-existent response file: ${response_file} " )
86- endif ()
87- else ()
88- list (APPEND expanded_args "${arg} " )
89- endif ()
90- endforeach ()
91- set (${output_var} ${expanded_args} PARENT_SCOPE)
92- endfunction ()
93-
94- expand_response_files("${compiler_args} " compiler_args)
95- expand_response_files("${linker_args} " linker_args)
96-
9762message (STATUS "CMAKE_EXE_LINKER_FLAGS: ${linker_args} " )
9863message (STATUS "CMAKE_CXX_FLAGS: ${compiler_args} " )
9964
0 commit comments