X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=CMakeLists.txt;h=9bfb74b8d5e270f7a48e08855c4c44e6c808318f;hb=e1c3a8744d3f78cac977b10f8f07532d3087dc4b;hp=d22b482ac0a2fcda11a5d111a0b3c3b9398bff76;hpb=5051ca449c670fa24bd7990ea6fa2b98d3141dd1;p=libcds.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d22b482a..9bfb74b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ 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 ASan+UBSan instrumented code" OFF) option(WITH_TSAN "Build TSan instrumented code" OFF) +option(ENABLE_UNIT_TEST "Enable unit test" ON) +option(ENABLE_STRESS_TEST "Enable stress test" ON) set(CMAKE_TARGET_ARCHITECTURE "" CACHE string "Target build architecture") find_package(Threads) @@ -115,6 +117,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_TARGET_ARCHITECTURE STREQUAL "x86_64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcx16") set(LIB_SUFFIX "64") + + # GCC-7: 128-bit atomics support is implemented via libatomic on amd64 + # see https://gcc.gnu.org/ml/gcc/2017-01/msg00167.html + # Maybe, it will be changed in future + if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.0.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -latomic") + endif() endif() if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")