Crosscompilation target architecture made required to be set explicitly
[libcds.git] / CMakeLists.txt
index 73a08be70df0e7f9bb3501fe085977370a5fda48..80fb3807f2a946a8ab392b3b3d9a91f0106b2035 100644 (file)
@@ -16,6 +16,7 @@ option(WITH_TESTS_COVERAGE "Analyze test coverage using gcov (only for gcc)" OFF
 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)
+set(CMAKE_TARGET_ARCHITECTURE "" CACHE string "Target build architecture")
 
 find_package(Threads)
 
@@ -27,7 +28,9 @@ endif()
 
 include_directories(${Boost_INCLUDE_DIRS})
 
-target_architecture(CMAKE_TARGET_ARCHITECTURE)
+if(NOT CMAKE_TARGET_ARCHITECTURE)
+    target_architecture(CMAKE_TARGET_ARCHITECTURE)
+endif()
 
 if(WITH_BOOST_ATOMIC)
     if(Boost_FOUND)