[PATCH] D118159: [CMake][MSVC] Add include path to crt headers when enabling sanitizers.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 12:26:05 PST 2022


rnk added a subscriber: cbezault.
rnk added inline comments.


================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:818
+      endif()
+      include_directories(SYSTEM ${MSVC_CRT_SRC_DIR})
+    endif()
----------------
I sent the previous comment too early, I see this now.

@cbezault , is there a reason MSVC doesn't ship asan_interface.h with the other includes? I imagine there could be some bad interaction if clang-cl finds the wrong asan_interface.h (MSVC's instead its own from compiler-rt), but clang puts its resource directory onto the search path first, so this should work.

If the usage if asan_interface.h is to call the LSan APIs, I think it would be reasonable to still use `__has_include`, since LSan support is new and somewhat optional. I would rather not add all internal crt sources to the header search paths used for all compiles in LLVM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118159/new/

https://reviews.llvm.org/D118159



More information about the llvm-commits mailing list