sanitizers.cmake 501 B

1234567891011121314151617181920
  1. if (NOT DRACO_CMAKE_SANITIZERS_CMAKE_)
  2. set(DRACO_CMAKE_SANITIZERS_CMAKE_ 1)
  3. if (MSVC OR NOT SANITIZE)
  4. return ()
  5. endif ()
  6. include("${draco_root}/cmake/compiler_flags.cmake")
  7. string(TOLOWER ${SANITIZE} SANITIZE)
  8. # Require the sanitizer requested.
  9. require_linker_flag("-fsanitize=${SANITIZE}")
  10. require_compiler_flag("-fsanitize=${SANITIZE}" YES)
  11. # Make callstacks accurate.
  12. require_compiler_flag("-fno-omit-frame-pointer -fno-optimize-sibling-calls" YES)
  13. endif() # DRACO_CMAKE_SANITIZERS_CMAKE_