Skip to content

Commit

Permalink
Prefer testing for "Clang" for symmetric support with macros in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Coeur committed Jul 22, 2023
1 parent c1b36fd commit 0da70b1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libtransmission/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ endif()

check_symbol_exists(SO_REUSEPORT "sys/types.h;sys/socket.h" HAVE_SO_REUSEPORT)

check_cxx_compiler_flag(-fobjc-arc CXX_COMPILER_SUPPORTS_OBJC_ARC)

add_compile_options(
# equivalent of XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES for this directory
$<$<AND:$<BOOL:${APPLE}>,$<BOOL:${CXX_COMPILER_SUPPORTS_OBJC_ARC}>,$<COMPILE_LANGUAGE:C,CXX>>:-fobjc-arc>)
$<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>,$<COMPILE_LANGUAGE:C,CXX>>:-fobjc-arc>)

add_library(${TR_NAME} STATIC)

Expand Down Expand Up @@ -206,10 +204,10 @@ tr_allow_compile_if(
watchdir-inotify.cc
[=[[WITH_KQUEUE]]=]
watchdir-kqueue.cc
[=[[APPLE AND CXX_COMPILER_SUPPORTS_OBJC_ARC]]=]
[=[[APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang"]]=]
tr-assert.mm
utils.mm
[=[[NOT (APPLE AND CXX_COMPILER_SUPPORTS_OBJC_ARC)]]=]
[=[[NOT (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")]]=]
tr-assert.cc
[=[[WIN32]]=]
file-win32.cc
Expand Down

0 comments on commit 0da70b1

Please sign in to comment.