mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
set default build type, add sanitizer build support
This commit is contained in:
parent
e9391c93fb
commit
d7c28021c8
1 changed files with 13 additions and 1 deletions
|
@ -16,10 +16,16 @@ project(chibi-scheme LANGUAGES C VERSION ${version}
|
|||
include(CheckIncludeFile)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
|
||||
"Build type: None, Debug, Release, RelWithDebInfo, MinSizeRel, or Sanitizer." FORCE)
|
||||
|
||||
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt AND NOT CMAKE_BUILD_TYPE)
|
||||
# CMake doesn't have a default build type, so set one manually
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
#
|
||||
# Features
|
||||
|
@ -86,6 +92,12 @@ if(NOT HAVE_POLL_H)
|
|||
target_compile_definitions(libchibi-common INTERFACE SEXP_USE_GREEN_THREADS=0)
|
||||
endif()
|
||||
|
||||
target_compile_options(libchibi-common
|
||||
INTERFACE
|
||||
$<$<CONFIG:SANITIZER>:-g
|
||||
-fsanitize=address,undefined,integer-divide-by-zero,float-divide-by-zero,float-cast-overflow,return
|
||||
-fno-omit-frame-pointer>)
|
||||
|
||||
#
|
||||
# Sources
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue