1 add_custom_target(PollyUnitTests)
2 set_target_properties(PollyUnitTests PROPERTIES FOLDER "Polly")
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 target_link_libraries(${test_name} Polly)
12 # The Polly target does not depend on its required libraries, except:
13 # - BUILD_SHARED_LIBS=ON
14 # in which case calling target_link_libraries again is redundant.
15 # - LLVM_LINK_LLVM_DYLIB=ON
16 # in which case it depends on libLLVM.so, so no additional libs needed.
17 # We are also not allowed to link against the plain LLVM* libraries,
18 # which would result in multiple instances of these to be loaded.
19 if (NOT LLVM_LINK_LLVM_DYLIB)
20 target_link_libraries(${test_name} LLVMCore LLVMSupport LLVMDemangle LLVMipo)
23 add_executable(${test_name} EXCLUDE_FROM_ALL ${ARGN})
24 set_target_properties(${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
26 target_link_libraries(${test_name} gtest_main gtest Polly ${LLVM_LIBS})
27 add_dependencies(PollyUnitTests ${test_name})
29 set_property(TARGET ${test_name} PROPERTY FOLDER "Polly")
34 add_subdirectory(Flatten)
35 add_subdirectory(DeLICM)