Merge pull request #578 from jpcima/faligned-new

Check the existence of flag -faligned-new and add it
This commit is contained in:
JP Cimalando 2020-12-13 16:19:49 +01:00 committed by GitHub
commit f6f398101b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,5 @@
include(CMakeDependentOption)
include(CheckCXXCompilerFlag)
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to be used")
set(CMAKE_C_STANDARD 99 CACHE STRING "C standard to be used")
@ -72,6 +73,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-mfloat-abi=hard)
endif()
endif()
check_cxx_compiler_flag(-faligned-new SFIZZ_HAVE_FALIGNED_NEW)
if(SFIZZ_HAVE_FALIGNED_NEW)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-faligned-new>)
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_STANDARD 17)
add_compile_options(/Zc:__cplusplus)