File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 25
25
matrix :
26
26
os : [ubuntu-latest, windows-latest]
27
27
build_type : [Release, Debug]
28
+ extra-cmake-flags : [""]
29
+ include :
30
+ - os : ubuntu-latest
31
+ build_type : Release
32
+ extra-cmake-flags : " -DSANITIZER=address"
33
+ - os : ubuntu-latest
34
+ build_type : Release
35
+ extra-cmake-flags : " -DSANITIZER=undefined"
28
36
29
37
steps :
30
38
- uses : actions/checkout@v4
41
49
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
42
50
run : >
43
51
cmake -B ${{ steps.strings.outputs.build-output-dir }}
44
- -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
52
+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.extra-cmake-flags }}
45
53
-S ${{ github.workspace }}
46
54
47
55
- name : Build
Original file line number Diff line number Diff line change @@ -26,13 +26,29 @@ set (TRIESTE_ENABLE_TESTING OFF)
26
26
FetchContent_MakeAvailable_ExcludeFromAll(trieste)
27
27
set (CMAKE_CXX_STANDARD 20)
28
28
29
+ if (SANITIZER)
30
+ message (STATUS "Run-time sanitizer=${SANITIZER} " )
31
+ endif ()
32
+ macro (add_san target )
33
+ # ASAN must be added first, or it gets upset.
34
+ if (SANITIZER)
35
+ if (MSVC )
36
+ message (FATAL_ERROR "MSVC does not support sanitizers" )
37
+ endif ()
38
+ target_compile_definitions (${target} INTERFACE -DSNMALLOC_PASS_THROUGH)
39
+ target_compile_options (${target} INTERFACE -g -fsanitize=${SANITIZER} -fno-omit-frame-pointer)
40
+ target_link_libraries (${target} INTERFACE -fsanitize=${SANITIZER} )
41
+ endif ()
42
+ endmacro ()
43
+
29
44
add_library (
30
45
rt OBJECT
31
46
src/rt/rt.cc
32
47
src/rt/objects/region.cc
33
48
src/rt/ui/mermaid.cc
34
49
src/rt/core/builtin.cc
35
50
)
51
+ add_san(rt)
36
52
37
53
add_library (
38
54
lang OBJECT
@@ -44,9 +60,13 @@ add_library(
44
60
src/lang/passes/flatten.cc
45
61
src/lang/passes/bytecode.cc
46
62
)
63
+ add_san(lang)
64
+
47
65
target_link_libraries (lang PRIVATE trieste::trieste)
48
66
49
67
add_executable (verona_dyn src/main.cc)
68
+ add_san(verona_dyn)
69
+
50
70
target_link_libraries (verona_dyn PRIVATE rt lang)
51
71
52
72
set_property (TARGET verona_dyn PROPERTY COMPILE_WARNING_AS_ERROR ON )
You can’t perform that action at this time.
0 commit comments