This commit is contained in:
Paul-Marie Masschelier 2025-09-09 20:42:24 -03:00 committed by GitHub
commit b9c49a0a3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,9 +2,19 @@ cmake_minimum_required(VERSION 3.27)
project(clay_examples_cpp_project_example CXX) project(clay_examples_cpp_project_example CXX)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g") macro(add_checked_flag FLAG)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("${FLAG}" SUPPORTED)
if(SUPPORTED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}")
else()
message(WARNING "${FLAG} not supported")
endif() endif()
endmacro()
add_checked_flag("-fsanitize=address")
add_checked_flag("-fno-omit-frame-pointer")
add_executable(clay_examples_cpp_project_example main.cpp) add_executable(clay_examples_cpp_project_example main.cpp)