From 8bfc0b80857dfa35b933f1bb8c5960de74273912 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 1 Nov 2019 19:35:47 +0100 Subject: [PATCH] Fix compiler flag --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4d1542be..2f85a621e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2501,7 +2501,12 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) endif() if(IS_ARM) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.1.0") - add_compile_options(-faligned-new) + set(CXX_ALIGN_FLAG -faligned-new) + if(NOT (CMAKE_VERSION VERSION_LESS "3.3")) + add_compile_options("$<$:${CXX_ALIGN_FLAG}>") + else() + add_compile_options("$<$,CXX>:${CXX_ALIGN_FLAG}>") + endif() endif() endif() endif()