llvm-project/polly/unittests/CMakeLists.txt
Michael Kruse c16538feb1
[polly] Revise IDE folder structure (#89752)
Update the folder titles for targets in the monorepository that have not
seen taken care of for some time. These are the folders that targets are
organized in Visual Studio and XCode
(`set_property(TARGET <target> PROPERTY FOLDER "<title>")`)
when using the respective CMake's IDE generator.

 * Ensure that every target is in a folder
 * Use a folder hierarchy with each LLVM subproject as a top-level folder
 * Use consistent folder names between subprojects
 * When using target-creating functions from AddLLVM.cmake, automatically
deduce the folder. This reduces the number of
`set_property`/`set_target_property`, but are still necessary when
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's
root CMakeLists.txt.
2024-05-25 17:43:05 +02:00

33 lines
1.1 KiB
CMake

add_custom_target(PollyUnitTests)
set_target_properties(PollyUnitTests PROPERTIES FOLDER "Polly/Tests")
# add_polly_unittest(test_dirname file1.cpp file2.cpp)
#
# Will compile the list of files together and link against Polly and its dependences.
function(add_polly_unittest test_name)
if(COMMAND add_unittest)
add_unittest(PollyUnitTests ${test_name} ${ARGN})
else()
add_executable(${test_name} EXCLUDE_FROM_ALL ${ARGN})
set_target_properties(${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(${test_name} PRIVATE gtest_main gtest)
add_dependencies(PollyUnitTests ${test_name})
endif()
set_property(TARGET ${test_name} PROPERTY FOLDER "Polly/Tests/Unit")
if(LLVM_LINK_LLVM_DYLIB AND LLVM_POLLY_LINK_INTO_TOOLS)
# In this case Polly is already present in libLLVM,
# no need to link it again.
else()
target_link_libraries(${test_name} PRIVATE Polly)
endif()
endfunction()
add_subdirectory(Isl)
add_subdirectory(Flatten)
add_subdirectory(DeLICM)
add_subdirectory(ScopPassManager)
add_subdirectory(ScheduleOptimizer)
add_subdirectory(Support)