[LICM] allow MemoryAccess creation failure (#116813)
[llvm-project.git] / polly / unittests / CMakeLists.txt
blob093a2146f63c5ead2a2dd01987532a6eb683caad
1 add_custom_target(PollyUnitTests)
2 set_target_properties(PollyUnitTests PROPERTIES FOLDER "Polly/Tests")
4 # add_polly_unittest(test_dirname file1.cpp file2.cpp)
6 # Will compile the list of files together and link against Polly and its dependences.
7 function(add_polly_unittest test_name)
8   if(COMMAND add_unittest)
9     add_unittest(PollyUnitTests ${test_name} ${ARGN})
10   else()
11     add_executable(${test_name} EXCLUDE_FROM_ALL ${ARGN})
12     set_target_properties(${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
14     target_link_libraries(${test_name} PRIVATE gtest_main gtest)
15     add_dependencies(PollyUnitTests ${test_name})
16   endif()
17   set_property(TARGET ${test_name} PROPERTY FOLDER "Polly/Tests/Unit")
19   if(LLVM_LINK_LLVM_DYLIB AND LLVM_POLLY_LINK_INTO_TOOLS)
20     # In this case Polly is already present in libLLVM,
21     # no need to link it again.
22   else()
23     target_link_libraries(${test_name} PRIVATE Polly)
24   endif()
25 endfunction()
27 add_subdirectory(Isl)
28 add_subdirectory(Flatten)
29 add_subdirectory(DeLICM)
30 add_subdirectory(ScopPassManager)
31 add_subdirectory(ScheduleOptimizer)
32 add_subdirectory(Support)