mirror of
				https://github.com/nicbarker/clay.git
				synced 2025-11-04 08:36:17 +00:00 
			
		
		
		
	Merge 75d1546476 into fd97d8179e
				
					
				
			This commit is contained in:
		
						commit
						74114d1944
					
				| 
						 | 
				
			
			@ -2,9 +2,19 @@ cmake_minimum_required(VERSION 3.27)
 | 
			
		|||
project(clay_examples_cpp_project_example CXX)
 | 
			
		||||
 | 
			
		||||
set(CMAKE_CXX_STANDARD 20)
 | 
			
		||||
if(NOT MSVC)
 | 
			
		||||
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
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()
 | 
			
		||||
endmacro()
 | 
			
		||||
 | 
			
		||||
add_checked_flag("-fsanitize=address")
 | 
			
		||||
add_checked_flag("-fno-omit-frame-pointer")
 | 
			
		||||
 | 
			
		||||
add_executable(clay_examples_cpp_project_example main.cpp)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue