Skip to content

Commit

Permalink
Enable warnings and sanitizers in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
theo543 committed May 25, 2024
1 parent 33cfff4 commit ff57d7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ cmake_minimum_required(VERSION 3.20)

project(hexcode)

if(CMAKE_C_COMPILER_ID STREQUAL "GNU|Clang")
add_compile_options(-Wall -Wextra -Wpedantic -g -O0)
if(LINUX)
add_compile_options(-fsanitize=address,undefined)
add_link_options(-fsanitize=address,undefined)
endif()
endif()

add_executable(hexcode hexcode.c data.c)

0 comments on commit ff57d7f

Please sign in to comment.