vcpkg/ports/libtorrent/fix-AppleClang-test.patch
JonLiu1993 eb41906384
[libtorrent] update to 1.2.12 (#15620)
* [libtorrent] update to 1.2.12

* update version

* fix AppleClang test

* update version
2021-03-11 12:24:25 -08:00

26 lines
872 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92592ec..8bfcd60 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -644,7 +644,9 @@ if (NOT Windows)
}
]=])
string(REPLACE "std::atomic<int>" "std::atomic<std::int64_t>" ATOMICS64_TEST_SOURCE "${ATOMICS_TEST_SOURCE}")
-
+ if(APPLE)
+ set(CMAKE_REQUIRED_FLAGS "-std=c++11")
+ endif()
check_cxx_source_compiles("${ATOMICS_TEST_SOURCE}" HAVE_CXX_ATOMICS_WITHOUT_LIB)
check_cxx_source_compiles("${ATOMICS64_TEST_SOURCE}" HAVE_CXX_ATOMICS64_WITHOUT_LIB)
if((NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) OR (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB))
@@ -659,6 +661,9 @@ if (NOT Windows)
target_link_libraries(torrent-rasterbar PUBLIC atomic)
endif()
endif()
+ if(APPLE)
+ unset(CMAKE_REQUIRED_FLAGS)
+ endif()
endif()
feature_option(build_tests "build tests" OFF)