diff options
author | Marcos Pividori <mpividori@google.com> | 2017-01-22 02:28:12 +0000 |
---|---|---|
committer | Marcos Pividori <mpividori@google.com> | 2017-01-22 02:28:12 +0000 |
commit | 76c58b44137c49f7d1b40f85d967a9b204b46aac (patch) | |
tree | 180c2be483642ba99952dc5daf034f9dee6bf3fa /llvm/lib/Fuzzer/test | |
parent | 0a4aeceb90650a24f4d426a20ec20749d232cf4b (diff) | |
download | bcm5719-llvm-76c58b44137c49f7d1b40f85d967a9b204b46aac.tar.gz bcm5719-llvm-76c58b44137c49f7d1b40f85d967a9b204b46aac.zip |
[libFuzzer] Specify the CRT considered (MT or MD) for tests on Windows.
Differential Revision: https://reviews.llvm.org/D28439
llvm-svn: 292749
Diffstat (limited to 'llvm/lib/Fuzzer/test')
-rw-r--r-- | llvm/lib/Fuzzer/test/CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/test/CMakeLists.txt b/llvm/lib/Fuzzer/test/CMakeLists.txt index f2dfcf21482..5f5ba57dcdf 100644 --- a/llvm/lib/Fuzzer/test/CMakeLists.txt +++ b/llvm/lib/Fuzzer/test/CMakeLists.txt @@ -18,6 +18,13 @@ endforeach() set(CMAKE_CXX_FLAGS "${LIBFUZZER_FLAGS_BASE} -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp,trace-div,trace-gep -gline-tables-only") if(MSVC) + # For tests use the CRT specified for release build + # (asan doesn't support MDd and MTd) + if ("${LLVM_USE_CRT_RELEASE}" STREQUAL "") + set(CRT_FLAG " /MD ") + else() + set(CRT_FLAG " /${LLVM_USE_CRT_RELEASE} ") + endif() # In order to use the sanitizers in Windows, we need to link against many # runtime libraries which will depend on the target being created # (executable or dll) and the c runtime library used (MT/MD). @@ -28,8 +35,8 @@ if(MSVC) # the rules for linking executables and shared libraries, using the compiler # instead of link.exe. Clang will consider the sanitizer flags, and # automatically provide the required libraries to the linker. - set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> ${CMAKE_CXX_FLAGS} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> /link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS>") - set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} /LD <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG> <TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> /link <LINK_FLAGS>") + set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> ${CMAKE_CXX_FLAGS} ${CRT_FLAG} <OBJECTS> -o <TARGET> <LINK_LIBRARIES> /link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS>") + set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} ${CRT_FLAG} /LD <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG> <TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> /link <LINK_FLAGS>") endif() # add_libfuzzer_test(<name> |