[compiler-rt] bd0a35e - [CMake] Use correct include flag for MSVC
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 29 18:29:18 PDT 2022
Author: Petr Hosek
Date: 2022-09-30T01:29:04Z
New Revision: bd0a35edfd0c10d54d297e76e86b7eae69eaf03f
URL: https://github.com/llvm/llvm-project/commit/bd0a35edfd0c10d54d297e76e86b7eae69eaf03f
DIFF: https://github.com/llvm/llvm-project/commit/bd0a35edfd0c10d54d297e76e86b7eae69eaf03f.diff
LOG: [CMake] Use correct include flag for MSVC
When building using the MSVC driver, we need to use /imsvc rather than
-isystem for system headers.
Differential Revision: https://reviews.llvm.org/D134864
Added:
Modified:
compiler-rt/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 2d99d3ae8317..9c43b67b6342 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -559,7 +559,7 @@ if (COMPILER_RT_CXX_LIBRARY STREQUAL "libcxx")
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_COMMON_CFLAGS)
append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ COMPILER_RT_COMMON_LINK_FLAGS)
# Use the in-tree libc++ through explicit include and library paths.
- set(COMPILER_RT_CXX_CFLAGS "$<$<TARGET_EXISTS:cxx-headers>:-isystem$<JOIN:$<TARGET_PROPERTY:cxx-headers,INTERFACE_INCLUDE_DIRECTORIES>,$<SEMICOLON>-isystem>>")
+ set(COMPILER_RT_CXX_CFLAGS "$<$<TARGET_EXISTS:cxx-headers>:$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>$<JOIN:$<TARGET_PROPERTY:cxx-headers,INTERFACE_INCLUDE_DIRECTORIES>,$<SEMICOLON>$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>>>")
if (COMPILER_RT_STATIC_CXX_LIBRARY)
set(COMPILER_RT_CXX_LINK_LIBS "$<TARGET_LINKER_FILE:cxx_static>")
else()
@@ -595,7 +595,7 @@ endif()
if (SANITIZER_TEST_CXX_LIBNAME STREQUAL "libc++")
if (SANITIZER_TEST_CXX_INTREE)
- list(APPEND SANITIZER_TEST_CXX_CFLAGS "$<$<TARGET_EXISTS:cxx-headers>:-isystem$<JOIN:$<TARGET_PROPERTY:cxx-headers,INTERFACE_INCLUDE_DIRECTORIES>,$<SEMICOLON>-isystem>>")
+ list(APPEND SANITIZER_TEST_CXX_CFLAGS "$<$<TARGET_EXISTS:cxx-headers>:$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>$<JOIN:$<TARGET_PROPERTY:cxx-headers,INTERFACE_INCLUDE_DIRECTORIES>,$<SEMICOLON>$<IF:$<BOOL:${MSVC}>,/imsvc,-isystem>>>")
if (SANITIZER_USE_STATIC_TEST_CXX)
list(APPEND SANITIZER_TEST_CXX_LIBRARIES "$<TARGET_LINKER_FILE:cxx_static>")
else()
More information about the llvm-commits
mailing list