From: Mikhail Komarov Date: Thu, 12 Jan 2017 02:20:25 +0000 (+0300) Subject: Buggy CMake try_compile when crosscompiling hacked with optional Threads X-Git-Tag: v2.3.0~209^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=793350cb0c1a1a431da76dd9c00e0eba635172c7;p=libcds.git Buggy CMake try_compile when crosscompiling hacked with optional Threads package availability --- 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)