[llvm] b9b954b - Fix Windows x86 compilation after a6a37a2fcd2a8048a75bd0d8280497ed89d73224

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 07:53:42 PDT 2020


Author: Alexandre Ganea
Date: 2020-08-28T10:53:20-04:00
New Revision: b9b954b8bbf0feed1aecde78cb6976134e460e91

URL: https://github.com/llvm/llvm-project/commit/b9b954b8bbf0feed1aecde78cb6976134e460e91
DIFF: https://github.com/llvm/llvm-project/commit/b9b954b8bbf0feed1aecde78cb6976134e460e91.diff

LOG: Fix Windows x86 compilation after a6a37a2fcd2a8048a75bd0d8280497ed89d73224

Added: 
    

Modified: 
    llvm/unittests/Support/DynamicLibrary/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt b/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt
index 00d20510ffd3..c241837e521a 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)
 


        


More information about the llvm-commits mailing list