diff options
author | Steven Perron <stevenperron@google.com> | 2019-04-11 23:33:26 +0300 |
---|---|---|
committer | David Neto <dneto@google.com> | 2019-04-11 23:33:26 +0300 |
commit | 2b46521cd77cb50c4b841a93d4025f3c67a7c4fc (patch) | |
tree | 55c8283a83e455e47f9ec03e503f39f8cec5ae92 /CMakeLists.txt | |
parent | 82ebbbba15c2adb7933489130374b43be970b8d4 (diff) |
Add -fsantize to link flags. (#2506)
The option "SPIRV_USE_SANITIZER=address" does not work as stated in our
documentation because the link step fails for the tools. We have to add
-fsanitize to the link flags so the correct libraries are added on the
link step.
Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/2482.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a5ecb90a1..352447572 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,8 @@ function(spvtools_default_compile_options TARGET) if(NOT "${SPIRV_USE_SANITIZER}" STREQUAL "") target_compile_options(${TARGET} PRIVATE -fsanitize=${SPIRV_USE_SANITIZER}) + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS -fsanitize=${SPIRV_USE_SANITIZER}) endif() target_compile_options(${TARGET} PRIVATE -ftemplate-depth=1024) |