Skip to content

Commit 30e983c

Browse files
authored
[lld] Revise IDE folder structure (#89747)
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 ccaccc3 commit 30e983c

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

lld/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
cmake_minimum_required(VERSION 3.20.0)
2+
set(LLVM_SUBPROJECT_TITLE "LLD")
23

34
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
45
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
@@ -192,6 +193,7 @@ add_subdirectory(tools/lld)
192193

193194
if (LLVM_INCLUDE_TESTS)
194195
add_custom_target(LLDUnitTests)
196+
set_target_properties(LLDUnitTests PROPERTIES FOLDER "LLD/Tests")
195197
if (TARGET llvm_gtest)
196198
add_subdirectory(unittests)
197199
endif()

lld/cmake/modules/AddLLD.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ macro(add_lld_library name)
1111
set(ARG_ENABLE_SHARED SHARED)
1212
endif()
1313
llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS})
14-
set_target_properties(${name} PROPERTIES FOLDER "lld libraries")
1514

1615
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
1716
get_target_export_arg(${name} LLD export_to_lldtargets)
@@ -33,7 +32,6 @@ endmacro(add_lld_library)
3332

3433
macro(add_lld_executable name)
3534
add_llvm_executable(${name} ${ARGN})
36-
set_target_properties(${name} PROPERTIES FOLDER "lld executables")
3735
endmacro(add_lld_executable)
3836

3937
macro(add_lld_tool name)

lld/test/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@ add_lit_testsuite(check-lld "Running lld test suite"
8383
${CMAKE_CURRENT_BINARY_DIR}
8484
DEPENDS ${LLD_TEST_DEPS}
8585
)
86-
set_target_properties(check-lld PROPERTIES FOLDER "lld tests")
8786

8887
add_custom_target(lld-test-depends DEPENDS ${LLD_TEST_DEPS})
89-
set_target_properties(lld-test-depends PROPERTIES FOLDER "lld tests")
88+
set_target_properties(lld-test-depends PROPERTIES FOLDER "LLD/Tests")
9089

9190
add_lit_testsuites(LLD ${CMAKE_CURRENT_SOURCE_DIR}
9291
DEPENDS ${LLD_TEST_DEPS}
@@ -95,4 +94,4 @@ add_lit_testsuites(LLD ${CMAKE_CURRENT_SOURCE_DIR}
9594
# Add a legacy target spelling: lld-test
9695
add_custom_target(lld-test)
9796
add_dependencies(lld-test check-lld)
98-
set_target_properties(lld-test PROPERTIES FOLDER "lld tests")
97+
set_target_properties(lld-test PROPERTIES FOLDER "LLD/Tests")

lld/unittests/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
set_target_properties(LLDUnitTests PROPERTIES FOLDER "lld tests")
2-
31
function(add_lld_unittests test_dirname)
42
add_unittest(LLDUnitTests ${test_dirname} ${ARGN})
53
endfunction()

0 commit comments

Comments
 (0)