From bc3f0b5a7781f07e09d22f7718cacea97cb6bdb0 Mon Sep 17 00:00:00 2001 From: yohannd1 Date: Sun, 29 Dec 2024 20:44:36 -0300 Subject: [PATCH] cross-mingw build: detect whether there is a -posix suffix --- scripts/Cross-MinGW.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/Cross-MinGW.cmake b/scripts/Cross-MinGW.cmake index 09871d6bb2..115057b639 100644 --- a/scripts/Cross-MinGW.cmake +++ b/scripts/Cross-MinGW.cmake @@ -1,7 +1,14 @@ set(TARGET_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32) -set(CMAKE_C_COMPILER ${TARGET_PREFIX}-gcc-posix) -set(CMAKE_CXX_COMPILER ${TARGET_PREFIX}-g++-posix) +find_program(found_posix ${TARGET_PREFIX}-gcc-posix) +if (found_posix) + set(CMAKE_C_COMPILER ${TARGET_PREFIX}-gcc-posix) + set(CMAKE_CXX_COMPILER ${TARGET_PREFIX}-g++-posix) +else() + set(CMAKE_C_COMPILER ${TARGET_PREFIX}-gcc) + set(CMAKE_CXX_COMPILER ${TARGET_PREFIX}-g++) +endif() + set(PKG_CONFIG_EXECUTABLE ${TARGET_PREFIX}-pkg-config) set(CMAKE_FIND_ROOT_PATH /usr/${TARGET_PREFIX})