aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorJonathan Metzman <metzman@chromium.org>2019-01-22 18:59:25 +0000
committerJonathan Metzman <metzman@chromium.org>2019-01-22 18:59:25 +0000
commite4e52f63756f5d5639809ca6c44e3d745744780a (patch)
tree9ddd949c5bf7023816eb37bc7ed515aa0e48acc8 /cmake
parentca5da89cdde6d31218a580dcf331afa3fe4bfdad (diff)
[libFuzzer][MSVC] Enable building libFuzzer with MSVC
Summary: Enable building libFuzzer with MSVC. * Don't try to include <endian.h> in FuzzerSHA1.cpp. MSVC doesn't have this header, and WINDOWS is always little endian (even on ARM) Subscribers: srhines, mgorny, javed.absar, kristof.beyls Differential Revision: https://reviews.llvm.org/D56510 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/config-ix.cmake11
1 files changed, 4 insertions, 7 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index e0ee5b86b..493154c59 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -317,13 +317,13 @@ if(APPLE)
# We're setting the flag manually for each target OS
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
-
+
set(DARWIN_COMMON_CFLAGS -stdlib=libc++)
set(DARWIN_COMMON_LINK_FLAGS
-stdlib=libc++
-lc++
-lc++abi)
-
+
check_linker_flag("-fapplication-extension" COMPILER_RT_HAS_APP_EXTENSION)
if(COMPILER_RT_HAS_APP_EXTENSION)
list(APPEND DARWIN_COMMON_LINK_FLAGS "-fapplication-extension")
@@ -344,7 +344,7 @@ if(APPLE)
# Figure out which arches to use for each OS
darwin_get_toolchain_supported_archs(toolchain_arches)
message(STATUS "Toolchain supported arches: ${toolchain_arches}")
-
+
if(NOT MACOSX_VERSION_MIN_FLAG)
darwin_test_archs(osx
DARWIN_osx_ARCHS
@@ -648,10 +648,7 @@ else()
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND FUZZER_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Android|Darwin|Linux|NetBSD|FreeBSD|OpenBSD|Fuchsia|Windows" AND
- # TODO: Support builds with MSVC.
- NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND
- NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+ OS_NAME MATCHES "Android|Darwin|Linux|NetBSD|FreeBSD|OpenBSD|Fuchsia|Windows")
set(COMPILER_RT_HAS_FUZZER TRUE)
else()
set(COMPILER_RT_HAS_FUZZER FALSE)