Buggy CMake try_compile when crosscompiling hacked with optional Threads
authorMikhail Komarov <nemo1369@gmail.com>
Thu, 12 Jan 2017 02:20:25 +0000 (05:20 +0300)
committerMikhail Komarov <nemo1369@gmail.com>
Thu, 12 Jan 2017 02:20:25 +0000 (05:20 +0300)
package availability

CMakeLists.txt

index adf6cfebd16f3de7dadcd8b9c0cf3c5fca200f6e..66d71b5c60056516d4cb4a853509d750810de1ca 100644 (file)
@@ -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)