Skip to content

Commit

Permalink
Use WIN32 AND NOT MINGW to detect the "native" Windows ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
qmfrederik committed Dec 29, 2023
1 parent 69d1e08 commit 2dc3beb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ set(libBlocksRuntime_COMPATIBILITY_HDRS
set(libobjc_CXX_SRCS
selector_table.cc
)
# Windows does not use DWARF EH
if (MSVC)
# Windows does not use DWARF EH, except when using the GNU ABI (MinGW)
if (WIN32 AND NOT MINGW)
list(APPEND libobjc_CXX_SRCS eh_win32_msvc.cc)
else ()
list(APPEND libobjc_C_SRCS eh_personality.c)
endif (MSVC)
endif (WIN32 AND NOT MINGW)

if (NOT EXISTS "${CMAKE_SOURCE_DIR}/third_party/robin-map/include/tsl/robin_map.h")
message(FATAL_ERROR "Git submodules not present, please run:\n\n"
Expand All @@ -129,7 +129,7 @@ if (NOT EXISTS "${CMAKE_SOURCE_DIR}/third_party/robin-map/include/tsl/robin_map.
endif ()


if (MSVC)
if (WIN32 AND NOT MINGW)
set(OLD_ABI_COMPAT_DEFAULT false)
else()
set(OLD_ABI_COMPAT_DEFAULT true)
Expand Down Expand Up @@ -186,7 +186,7 @@ if(WIN32)
endif()


if (MSVC)
if (WIN32 AND NOT MINGW)
set(ASSEMBLER ${CMAKE_ASM_COMPILER} CACHE STRING "Assembler to use with Visual Studio (must be gcc / clang!)")
message(STATUS "Using custom build commands to work around CMake bugs")
message(STATUS "ASM compiler: ${ASSEMBLER}")
Expand All @@ -207,7 +207,7 @@ endif()



if (MSVC)
if (WIN32 AND NOT MINGW)
message(STATUS "Using MSVC-compatible exception model")
else ()
separate_arguments(EH_PERSONALITY_FLAGS NATIVE_COMMAND ${CMAKE_CXX_FLAGS})
Expand All @@ -231,7 +231,7 @@ target_sources(objc PRIVATE ${libobjc_CXX_SRCS})
include(FindThreads)
target_link_libraries(objc Threads::Threads)
# Link against ntdll.dll for RtlRaiseException
if (MSVC)
if (WIN32 AND NOT MINGW)
target_link_libraries(objc ntdll.dll)
endif()

Expand Down

0 comments on commit 2dc3beb

Please sign in to comment.