Skip to content

Commit

Permalink
cross-mingw build: detect whether there is a -posix suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
yohannd1 authored and tildearrow committed Dec 30, 2024
1 parent 68eeef2 commit bc3f0b5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/Cross-MinGW.cmake
Original file line number Diff line number Diff line change
@@ -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})
Expand Down

0 comments on commit bc3f0b5

Please sign in to comment.