Skip to content

Commit

Permalink
Revise IDE folder structure (llvm#89755)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Meinersbur authored May 25, 2024
1 parent 8bdc577 commit e14f5f2
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 5 deletions.
6 changes: 1 addition & 5 deletions cross-project-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# The subset inside debuginfo-tests invoke clang to generate programs with
# various types of debug info, and then run those programs under a debugger
# such as GDB or LLDB to verify the results.
set(LLVM_SUBPROJECT_TITLE "Cross-Project")

find_package(Python3 COMPONENTS Interpreter)

Expand Down Expand Up @@ -97,8 +98,3 @@ add_lit_testsuite(check-cross-amdgpu "Running AMDGPU cross-project tests"
add_lit_testsuites(CROSS_PROJECT ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${CROSS_PROJECT_TEST_DEPS}
)

set_target_properties(check-cross-project PROPERTIES FOLDER "Tests")
set_target_properties(check-debuginfo PROPERTIES FOLDER "Tests")
set_target_properties(check-intrinsic-headers PROPERTIES FOLDER "Tests")
set_target_properties(check-cross-amdgpu PROPERTIES FOLDER "Tests")
1 change: 1 addition & 0 deletions libc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "libc")

# Include LLVM's cmake policies.
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
Expand Down
1 change: 1 addition & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Setup Project
#===============================================================================
cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "libc++")

set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")

Expand Down
1 change: 1 addition & 0 deletions libcxxabi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#===============================================================================

cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "libc++abi")

set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")

Expand Down
1 change: 1 addition & 0 deletions libunwind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#===============================================================================

cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "libunwind")

set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")

Expand Down
1 change: 1 addition & 0 deletions llvm-libgcc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#===============================================================================

cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "LLVM libgcc")

set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")

Expand Down
1 change: 1 addition & 0 deletions offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# to build offload with CMake.

cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "liboffload")

if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(OPENMP_STANDALONE_BUILD TRUE)
Expand Down
1 change: 1 addition & 0 deletions pstl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#
#===----------------------------------------------------------------------===##
cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "Parallel STL")

set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")
Expand Down
2 changes: 2 additions & 0 deletions runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/LLVMVersion.cmake)

project(Runtimes C CXX ASM)
set(LLVM_SUBPROJECT_TITLE "Runtimes")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
Expand Down

0 comments on commit e14f5f2

Please sign in to comment.