From b9b954b8bbf0feed1aecde78cb6976134e460e91 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Fri, 28 Aug 2020 10:53:20 -0400 Subject: [PATCH] Fix Windows x86 compilation after a6a37a2fcd2a8048a75bd0d8280497ed89d73224 --- llvm/unittests/Support/DynamicLibrary/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt b/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt index 00d20510f..c241837 100644 --- a/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt +++ b/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt @@ -39,13 +39,15 @@ function(dynlib_add_module NAME) add_dependencies(DynamicLibraryTests ${NAME}) - # We need to link in the Support lib for the Memory allocator override, - # otherwise the DynamicLibrary.Shutdown test will fail, because it would - # allocate memory with the CRT allocator, and release it with our custom - # allocator (see llvm/lib/Support/Windows/Memory.inc). - # /INCLUDE:malloc is there to force searching into LLVMSupport before libucrt - llvm_map_components_to_libnames(llvm_libs Support) - target_link_libraries(${NAME} ${llvm_libs} "-INCLUDE:malloc") + if(LLVM_INTEGRATED_CRT_ALLOC) + # We need to link in the Support lib for the Memory allocator override, + # otherwise the DynamicLibrary.Shutdown test will fail, because it would + # allocate memory with the CRT allocator, and release it with our custom + # allocator (see llvm/lib/Support/Windows/Memory.inc). + # /INCLUDE:malloc is there to force searching into LLVMSupport before libucrt + llvm_map_components_to_libnames(llvm_libs Support) + target_link_libraries(${NAME} ${llvm_libs} "-INCLUDE:malloc") + endif() endfunction(dynlib_add_module) -- 2.7.4