File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,12 +189,29 @@ function(rtosc_add_test testname testbinary)
189189 set (_runner_temp "" )
190190 endif ()
191191
192+ # Dynamically find the GCC private lib directory for the MinGW cross-compiler.
193+ # This avoids hard-coding the GCC version (e.g. "13-win32") which changes
194+ # across runner image updates and different toolchain installations.
195+ execute_process (
196+ COMMAND x86_64-w64-mingw32-gcc -print-libgcc-file-name
197+ OUTPUT_VARIABLE _mingw_libgcc_file
198+ OUTPUT_STRIP_TRAILING_WHITESPACE
199+ ERROR_QUIET
200+ )
201+ if (_mingw_libgcc_file)
202+ get_filename_component (_mingw_gcc_lib_dir "${_mingw_libgcc_file} " DIRECTORY )
203+ else ()
204+ set (_mingw_gcc_lib_dir "" )
205+ endif ()
206+
192207 # Compose WINEPATH
193208 set (_winepath
194209 "/usr/x86_64-w64-mingw32/bin/;"
195210 "/usr/x86_64-w64-mingw32/lib/;"
196- "/usr/lib/gcc/x86_64-w64-mingw32/13-win32"
197211 )
212+ if (_mingw_gcc_lib_dir)
213+ list (APPEND _winepath "${_mingw_gcc_lib_dir} " )
214+ endif ()
198215
199216 if (_runner_temp)
200217 list (APPEND _winepath
You can’t perform that action at this time.
0 commit comments