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()