From 14cb27da034c014825387c0a5a62184bb3b897e7 Mon Sep 17 00:00:00 2001 From: Aggelos Tselios Date: Fri, 24 May 2024 16:20:01 +0300 Subject: [PATCH] CMakeLists.txt: Disable ARC on macOS X See #55 for details. Should fix a crash on macOS where the object is freed twice. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf72df8..fbb9850 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,8 @@ if (MACOSX) add_library(nvdialog SHARED ${NVD_SOURCES}) endif(NVD_BUILD_STATIC) add_compile_definitions(NVD_USE_COCOA=1) + # See #55 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-objc-arc") target_link_libraries(nvdialog "-framework AppKit" "-framework Cocoa" @@ -139,8 +141,6 @@ if (WIN32 OR WIN32_TARGET) endif(NVD_BUILD_STATIC) message("-- Compiling a Windows library.") target_link_libraries(nvdialog comdlg32 shell32 user32) -elseif(MACOSX) - else(WIN32 OR WIN32_TARGET) find_package(PkgConfig) if (PKG_CONFIG_FOUND)