aboutsummaryrefslogtreecommitdiff
path: root/cmake/toolchain/x86_64-w64-mingw32.cmake
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2025-04-25 22:38:33 +0300
committerMikhail Romanko <me@blankhex.com>2025-04-25 22:38:33 +0300
commit48ddd91dd4b366e77414d0d836627dad5d4b20a7 (patch)
tree1263a31119bcf82120834ee8f2e112bef15536ce /cmake/toolchain/x86_64-w64-mingw32.cmake
parent27ad496ca64339b1329957f9f85365bfa27d1205 (diff)
downloadbhlib-48ddd91dd4b366e77414d0d836627dad5d4b20a7.tar.gz
Fix MacOS and POSIX semaphores related issues
Recently got a MacBook Pro and decided to check how things build on MacOS. Discovered that POSIX unnamed semaphores weren't implemented, so I reimplemented them with conditional variable and mutex. Additionally, fixed scripts and CMake on MacOS
Diffstat (limited to 'cmake/toolchain/x86_64-w64-mingw32.cmake')
-rw-r--r--cmake/toolchain/x86_64-w64-mingw32.cmake24
1 files changed, 18 insertions, 6 deletions
diff --git a/cmake/toolchain/x86_64-w64-mingw32.cmake b/cmake/toolchain/x86_64-w64-mingw32.cmake
index c486f6a..e5f8b08 100644
--- a/cmake/toolchain/x86_64-w64-mingw32.cmake
+++ b/cmake/toolchain/x86_64-w64-mingw32.cmake
@@ -2,13 +2,25 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
-# which compilers to use for C and C++ and ASM-ATT
-SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
-SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
-SET(CMAKE_ASM-ATT_COMPILER /usr/bin/x86_64-w64-mingw32-as)
-# here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
+# Check path
+if(EXISTS /usr/bin/x86_64-w64-mingw32-gcc)
+ # which compilers to use for C and C++ and ASM-ATT
+ SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
+ SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
+ SET(CMAKE_ASM-ATT_COMPILER /usr/bin/x86_64-w64-mingw32-as)
+
+ # here is the target environment located
+ SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
+elseif(EXISTS /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-gcc)
+ # which compilers to use for C and C++ and ASM-ATT
+ SET(CMAKE_C_COMPILER /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-gcc)
+ SET(CMAKE_CXX_COMPILER /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-g++)
+ SET(CMAKE_ASM-ATT_COMPILER /usr/local/opt/mingw-w64/toolchain-x86_64/bin/x86_64-w64-mingw32-as)
+
+ # here is the target environment located
+ SET(CMAKE_FIND_ROOT_PATH /usr/local/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32)
+endif()
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search