From 499ee952f471fbc0a19ee450efd0849ab54396a2 Mon Sep 17 00:00:00 2001 From: Albin Joy Date: Fri, 27 Jul 2018 21:28:43 +0530 Subject: [PATCH] [BUILD] warning fix: new does not have an alignment parameter (#1478) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 81630841..39776d53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,10 @@ else(MSVC) check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11) set(CMAKE_C_FLAGS "-O2 -Wall -fPIC ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -std=c++11 ${CMAKE_CXX_FLAGS}") + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set(CMAKE_CXX_FLAGS "-faligned-new ${CMAKE_CXX_FLAGS}") + endif() endif(MSVC) # add source group