fix: -fobjc-arc with GCC (#5632)

This commit is contained in:
Cœur 2023-07-30 03:57:43 +02:00 committed by GitHub
parent ec0567e09f
commit 84f9d01e7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ check_symbol_exists(SO_REUSEPORT "sys/types.h;sys/socket.h" HAVE_SO_REUSEPORT)
add_compile_options(
# equivalent of XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES for this directory
$<$<AND:$<BOOL:${APPLE}>,$<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)
@ -204,10 +204,10 @@ tr_allow_compile_if(
watchdir-inotify.cc
[=[[WITH_KQUEUE]]=]
watchdir-kqueue.cc
[=[[APPLE]]=]
[=[[APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang"]]=]
tr-assert.mm
utils.mm
[=[[NOT APPLE]]=]
[=[[NOT (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")]]=]
tr-assert.cc
[=[[WIN32]]=]
file-win32.cc

View File

@ -274,7 +274,7 @@ double tr_getRatio(uint64_t numerator, uint64_t denominator)
// ---
#ifndef __APPLE__
#if !(defined(__APPLE__) && defined(__clang__))
std::string tr_strv_convert_utf8(std::string_view sv)
{