llvm.org GIT mirror llvm / 70b7a2f
[CMake] Provide direct support for building sanitized runtimes This avoids having to rely on magic separators and special parsing. Differential Revision: https://reviews.llvm.org/D48061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335704 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 1 year, 2 months ago
1 changed file(s) with 27 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
506506 endif()
507507
508508 foreach(name ${LLVM_RUNTIME_TARGETS})
509 set(target ${name})
510 string(REPLACE ":" ";" target_list ${target})
511 list(GET target_list 0 name)
512 list(LENGTH target_list target_list_len)
513 if(${target_list_len} GREATER 1)
514 list(GET target_list 1 target)
515 endif()
516
517 runtime_register_target(${name} ${target}
509 runtime_register_target(${name} ${name}
518510 DEPS ${deps}
519511 )
520512
526518 add_dependencies(check-runtimes check-runtimes-${name})
527519 add_dependencies(runtimes-test-depends runtimes-test-depends-${name})
528520 endif()
521 endforeach()
522
523 foreach(sanitizer ${LLVM_RUNTIME_SANITIZERS})
524 if (sanitizer STREQUAL "Address")
525 set(sanitizer_name "asan")
526 elseif (sanitizer STREQUAL "Memory")
527 set(sanitizer_name "msan")
528 elseif (sanitizer STREQUAL "Thread")
529 set(sanitizer_name "tsan")
530 elseif (sanitizer STREQUAL "Undefined")
531 set(sanitizer_name "ubsan")
532 else()
533 message(FATAL_ERROR "Unsupported value of LLVM_RUNTIME_TARGET_SANITIZERS: ${sanitizers}")
534 endif()
535 foreach(name ${LLVM_RUNTIME_SANITIZER_${sanitizer}_TARGETS})
536 runtime_register_target(${name}-${sanitizer_name} ${name}
537 DEPS runtimes-${name}
538 CMAKE_ARGS -DLLVM_USE_SANITIZER=${sanitizer}
539 -DLLVM_RUNTIMES_PREFIX=${name}/
540 -DLLVM_RUNTIMES_LIBDIR_SUFFIX=/${sanitizer_name}
541 )
542 add_dependencies(runtimes runtimes-${name}-${sanitizer_name})
543 add_dependencies(runtimes-configure runtimes-${name}-${sanitizer_name}-configure)
544 add_dependencies(install-runtimes install-runtimes-${name}-${sanitizer_name})
545 add_dependencies(install-runtimes-stripped install-runtimes-${name}-${sanitizer_name}-stripped)
546 endforeach()
529547 endforeach()
530548 endif()
531549