diff --git a/.cirrus.yml b/.cirrus.yml index 352f31c..4336fc8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,11 +3,14 @@ build_task: - name: FreeBSD 13 freebsd_instance: image: freebsd-13-2-release-amd64 + - name: FreeBSD 14 + freebsd_instance: + image: freebsd-14-0-release-amd64-ufs setup_script: sudo pkg install -y lua54 cmake configure_script: - mkdir build - - cd build && cmake .. + - cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. build_script: make -C build test_script: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fdb06c..dbae39a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: - name: configure run: | mkdir build - cd build && cmake .. + cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. - name: build orch(1) run: make -C build - name: Run self-tests diff --git a/CMakeLists.txt b/CMakeLists.txt index df6509e..b702e44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,11 @@ option(EXAMPLES "Install examples" ON) option(MANPAGES "Install manpages" ON) option(BUILD_DRIVER "Build the orch(1) driver" ON) +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) +endif() + if(EXAMPLES) add_subdirectory(examples) endif() diff --git a/lib/core/CMakeLists.txt b/lib/core/CMakeLists.txt index 9f2cc78..c1c24ed 100644 --- a/lib/core/CMakeLists.txt +++ b/lib/core/CMakeLists.txt @@ -3,7 +3,7 @@ file(GLOB core_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.c) set(warnings "-Wall -Wextra -Werror") if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") + add_compile_options(-D_GNU_SOURCE) endif() add_library(core SHARED ${core_SOURCES})