Fix C++ aligned allocation detected in the CMake build

This commit is contained in:
Lennox Ho 2023-09-21 10:31:29 +08:00 committed by Aliaksey Kandratsenka
parent 589d416977
commit 64d64bee40

View File

@ -44,6 +44,7 @@ if(CMAKE_SYSTEM MATCHES Linux)
endif()
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckFunctionExists)
@ -290,10 +291,13 @@ check_cxx_source_compiles("
HAVE_STD_ALIGN_VAL_T)
if(HAVE_STD_ALIGN_VAL_T)
set(HAVE_STD_ALIGN_VAL_T 1)
set(ENABLE_ALIGNED_NEW_DELETE 1)
else()
set(HAVE_STD_ALIGN_VAL_T 0)
endif()
check_cxx_compiler_flag("-faligned-new" have_f_aligned_new)
check_c_source_compiles("
#include <unwind.h>
int main()