Skip to content

Commit

Permalink
CMakeLists.txt: Disable ARC on macOS X
Browse files Browse the repository at this point in the history
See #55 for details. Should fix a crash on macOS where the object is freed twice.
  • Loading branch information
tseli0s committed May 24, 2024
1 parent 1490c26 commit 14cb27d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 14cb27d

Please sign in to comment.