Skip to content

Commit 91bdef5

Browse files
Add RESULT_VARIABLE to MinGW GCC detection for better error handling
Co-authored-by: JohannesLorenz <1042576+JohannesLorenz@users.noreply.github.com>
1 parent ff2741a commit 91bdef5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,11 @@ function(rtosc_add_test testname testbinary)
195195
execute_process(
196196
COMMAND x86_64-w64-mingw32-gcc -print-libgcc-file-name
197197
OUTPUT_VARIABLE _mingw_libgcc_file
198+
RESULT_VARIABLE _mingw_gcc_result
198199
OUTPUT_STRIP_TRAILING_WHITESPACE
199200
ERROR_QUIET
200201
)
201-
if(_mingw_libgcc_file)
202+
if(_mingw_gcc_result EQUAL 0 AND _mingw_libgcc_file)
202203
get_filename_component(_mingw_gcc_lib_dir "${_mingw_libgcc_file}" DIRECTORY)
203204
else()
204205
set(_mingw_gcc_lib_dir "")

0 commit comments

Comments
 (0)