From 4e5c2ff620cc67f2f87e37ffeab2583b13b662bb Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 22 May 2017 11:12:08 -0400 Subject: [PATCH] add AVX option to cmake build system --- build/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 779740da..06e1c24f 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -8,6 +8,7 @@ project ( "i2pd" ) # configurale options option(WITH_AESNI "Use AES-NI instructions set" OFF) +option(WITH_AVX "Use AVX instructions" OFF) option(WITH_HARDENING "Use hardening compiler flags" OFF) option(WITH_LIBRARY "Build library" ON) option(WITH_BINARY "Build binary" ON) @@ -213,6 +214,10 @@ if (WITH_AESNI) add_definitions ( -DAESNI ) endif() +if (WITH_AVX) + set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx" ) +endif() + if (WITH_ADDRSANITIZER) if (NOT MSVC) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer" ) @@ -379,6 +384,7 @@ message(STATUS "Compiler path : ${CMAKE_CXX_COMPILER}") message(STATUS "Install prefix: : ${CMAKE_INSTALL_PREFIX}") message(STATUS "Options:") message(STATUS " AESNI : ${WITH_AESNI}") +message(STATUS " AVX : ${WITH_AVX}") message(STATUS " HARDENING : ${WITH_HARDENING}") message(STATUS " LIBRARY : ${WITH_LIBRARY}") message(STATUS " BINARY : ${WITH_BINARY}")