From 793350cb0c1a1a431da76dd9c00e0eba635172c7 Mon Sep 17 00:00:00 2001 From: Mikhail Komarov Date: Thu, 12 Jan 2017 05:20:25 +0300 Subject: [PATCH] Buggy CMake try_compile when crosscompiling hacked with optional Threads package availability --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index adf6cfeb..66d71b5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,11 @@ option(WITH_BOOST_ATOMIC "Use boost atomics (only for boost >= 1.54)" OFF) option(WITH_ASAN "Build AddressSantinizer instrumented code" OFF) option(WITH_TSAN "Build ThreadSantinizer instrumented code" OFF) -find_package(Threads REQUIRED) +if(CMAKE_CROSSCOMPILING) + find_package(Threads) +else() + find_package(Threads REQUIRED) +endif() if(TARGET boost::system AND TARGET boost::thread) link_libraries(boost::system boost::thread) -- 2.34.1