Skip to content

Commit c16538f

Browse files
authored
[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.
1 parent e14f5f2 commit c16538f

File tree

7 files changed

+12
-17
lines changed

7 files changed

+12
-17
lines changed

polly/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
44
cmake_minimum_required(VERSION 3.20.0)
55
set(POLLY_STANDALONE_BUILD TRUE)
66
endif()
7+
set(LLVM_SUBPROJECT_TITLE "Polly")
78

89
# Must go below project(..)
910
include(GNUInstallDirs)
@@ -157,8 +158,7 @@ foreach (file IN LISTS files)
157158
endforeach ()
158159

159160
add_custom_target(polly-check-format DEPENDS ${check_format_depends})
160-
set_target_properties(polly-check-format PROPERTIES FOLDER "Polly")
161+
set_target_properties(polly-check-format PROPERTIES FOLDER "Polly/Metatargets")
161162

162163
add_custom_target(polly-update-format DEPENDS ${update_format_depends})
163-
set_target_properties(polly-update-format PROPERTIES FOLDER "Polly")
164-
164+
set_target_properties(polly-update-format PROPERTIES FOLDER "Polly/Metatargets")

polly/cmake/polly_macros.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ macro(add_polly_library name)
2121
set(libkind)
2222
endif()
2323
add_library( ${name} ${libkind} ${srcs} )
24-
set_target_properties(${name} PROPERTIES FOLDER "Polly")
24+
set_target_properties(${name} PROPERTIES FOLDER "Polly/Libraries")
2525

2626
if( LLVM_COMMON_DEPENDS )
2727
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
@@ -64,7 +64,7 @@ macro(add_polly_loadable_module name)
6464
endif()
6565
set(MODULE TRUE)
6666
add_polly_library(${name} ${srcs})
67-
set_target_properties(${name} PROPERTIES FOLDER "Polly")
67+
set_target_properties(${name} PROPERTIES FOLDER "Polly/Loadable Modules")
6868
if (GLOBAL_NOT_MODULE)
6969
unset (MODULE)
7070
endif()

polly/docs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ if (LLVM_ENABLE_DOXYGEN)
7777
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
7878
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7979
COMMENT "Generating polly doxygen documentation." VERBATIM)
80+
set_target_properties(doxygen-polly PROPERTIES FOLDER "Polly/Docs")
8081

8182
if (LLVM_BUILD_DOCS)
8283
add_dependencies(doxygen doxygen-polly)

polly/lib/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ add_llvm_pass_plugin(Polly
9292
LINK_COMPONENTS
9393
${POLLY_COMPONENTS}
9494
)
95-
set_target_properties(obj.Polly PROPERTIES FOLDER "Polly")
96-
set_target_properties(Polly PROPERTIES FOLDER "Polly")
9795

9896
if (MSVC_IDE OR XCODE)
9997
# Configure source groups for Polly source files. By default, in the IDE there
@@ -120,7 +118,7 @@ if (WIN32 OR CYGWIN OR NOT LLVM_ENABLE_PIC)
120118
# Add dummy target, either because loadable modules are not supported
121119
# as on Windows or because PIC code has been disabled
122120
add_custom_target(LLVMPolly)
123-
set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
121+
set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly/Loadable Modules")
124122
else ()
125123
add_polly_loadable_module(LLVMPolly
126124
Plugin/Polly.cpp

polly/lib/External/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ if (POLLY_BUNDLED_ISL)
302302
add_executable(polly-isl-test
303303
isl/isl_test.c
304304
)
305-
set_target_properties(polly-isl-test PROPERTIES FOLDER "Polly")
305+
set_target_properties(polly-isl-test PROPERTIES FOLDER "Polly/Tests")
306306

307307
target_link_libraries(polly-isl-test PRIVATE
308308
PollyISL

polly/test/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(LLVM_SHLIBEXT "${CMAKE_SHARED_MODULE_SUFFIX}")
22

33
add_custom_target(check-polly)
4-
set_target_properties(check-polly PROPERTIES FOLDER "Polly")
4+
set_target_properties(check-polly PROPERTIES FOLDER "Polly/Meta")
55

66
if(NOT LLVM_MAIN_SRC_DIR)
77
find_program(LLVM_OPT NAMES opt HINTS ${LLVM_TOOLS_BINARY_DIR})
@@ -64,7 +64,6 @@ add_lit_testsuite(check-polly-tests "Running polly regression tests"
6464
polly_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
6565
DEPENDS ${POLLY_TEST_DEPS}
6666
)
67-
set_target_properties(check-polly-tests PROPERTIES FOLDER "Polly")
6867
add_dependencies(check-polly check-polly-tests)
6968

7069
configure_lit_site_cfg(
@@ -80,7 +79,6 @@ if (POLLY_GTEST_AVAIL)
8079
EXCLUDE_FROM_CHECK_ALL
8180
DEPENDS PollyUnitTests
8281
)
83-
set_target_properties(check-polly-unittests PROPERTIES FOLDER "Polly")
8482
endif ()
8583

8684
configure_file(
@@ -94,7 +92,6 @@ if (POLLY_BUNDLED_ISL)
9492
EXCLUDE_FROM_CHECK_ALL
9593
DEPENDS polly-isl-test
9694
)
97-
set_target_properties(check-polly-isl PROPERTIES FOLDER "Polly")
9895
endif (POLLY_BUNDLED_ISL)
9996

10097
# Run polly-check-format as part of polly-check only if we are compiling with
@@ -114,5 +111,5 @@ configure_file(
114111

115112
# Add a legacy target spelling: polly-test
116113
add_custom_target(polly-test)
117-
set_target_properties(polly-test PROPERTIES FOLDER "Polly")
114+
set_target_properties(polly-test PROPERTIES FOLDER "Polly/Metatargets")
118115
add_dependencies(polly-test check-polly)

polly/unittests/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
add_custom_target(PollyUnitTests)
2-
set_target_properties(PollyUnitTests PROPERTIES FOLDER "Polly")
2+
set_target_properties(PollyUnitTests PROPERTIES FOLDER "Polly/Tests")
33

44
# add_polly_unittest(test_dirname file1.cpp file2.cpp)
55
#
@@ -13,9 +13,8 @@ function(add_polly_unittest test_name)
1313

1414
target_link_libraries(${test_name} PRIVATE gtest_main gtest)
1515
add_dependencies(PollyUnitTests ${test_name})
16-
17-
set_property(TARGET ${test_name} PROPERTY FOLDER "Polly")
1816
endif()
17+
set_property(TARGET ${test_name} PROPERTY FOLDER "Polly/Tests/Unit")
1918

2019
if(LLVM_LINK_LLVM_DYLIB AND LLVM_POLLY_LINK_INTO_TOOLS)
2120
# In this case Polly is already present in libLLVM,

0 commit comments

Comments
 (0)