Skip to content

[clang] Revise IDE folder structure #89743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 25, 2024
Merged
8 changes: 5 additions & 3 deletions clang/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 "Clang")

if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
Expand Down Expand Up @@ -391,14 +392,15 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
# Installing the headers needs to depend on generating any public
# tablegen'd headers.
add_custom_target(clang-headers DEPENDS clang-tablegen-targets)
set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
set_target_properties(clang-headers PROPERTIES FOLDER "Clang/Resources")
if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-clang-headers
DEPENDS clang-headers
COMPONENT clang-headers)
endif()

add_custom_target(bash-autocomplete DEPENDS utils/bash-autocomplete.sh)
set_target_properties(bash-autocomplete PROPERTIES FOLDER "Clang/Misc")
install(FILES utils/bash-autocomplete.sh
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
COMPONENT bash-autocomplete)
Expand Down Expand Up @@ -479,7 +481,7 @@ add_custom_target(clang-tablegen-targets
omp_gen
ClangDriverOptions
${CLANG_TABLEGEN_TARGETS})
set_target_properties(clang-tablegen-targets PROPERTIES FOLDER "Misc")
set_target_properties(clang-tablegen-targets PROPERTIES FOLDER "Clang/Tablegenning/Targets")
list(APPEND LLVM_COMMON_DEPENDS clang-tablegen-targets)

# Force target to be built as soon as possible. Clang modules builds depend
Expand Down Expand Up @@ -544,7 +546,7 @@ endif()

# Custom target to install all clang libraries.
add_custom_target(clang-libraries)
set_target_properties(clang-libraries PROPERTIES FOLDER "Misc")
set_target_properties(clang-libraries PROPERTIES FOLDER "Clang/Install")

if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-clang-libraries
Expand Down
2 changes: 1 addition & 1 deletion clang/bindings/python/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ add_custom_target(check-clang-python
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)

set(RUN_PYTHON_TESTS TRUE)
set_target_properties(check-clang-python PROPERTIES FOLDER "Clang tests")
set_target_properties(check-clang-python PROPERTIES FOLDER "Clang/Tests")

# Tests require libclang.so which is only built with LLVM_ENABLE_PIC=ON
if(NOT LLVM_ENABLE_PIC)
Expand Down
3 changes: 0 additions & 3 deletions clang/cmake/modules/AddClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function(clang_tablegen)

if(CTG_TARGET)
add_public_tablegen_target(${CTG_TARGET})
set_target_properties( ${CTG_TARGET} PROPERTIES FOLDER "Clang tablegenning")
set_property(GLOBAL APPEND PROPERTY CLANG_TABLEGEN_TARGETS ${CTG_TARGET})
endif()
endfunction(clang_tablegen)
Expand Down Expand Up @@ -138,13 +137,11 @@ macro(add_clang_library name)
endif()
endforeach()

set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
set_clang_windows_version_resource_properties(${name})
endmacro(add_clang_library)

macro(add_clang_executable name)
add_llvm_executable( ${name} ${ARGN} )
set_target_properties(${name} PROPERTIES FOLDER "Clang executables")
set_clang_windows_version_resource_properties(${name})
endmacro(add_clang_executable)

Expand Down
1 change: 1 addition & 0 deletions clang/docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if (LLVM_ENABLE_DOXYGEN)
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating clang doxygen documentation." VERBATIM)
set_target_properties(doxygen-clang PROPERTIES FOLDER "Clang/Docs")

if (LLVM_BUILD_DOCS)
add_dependencies(doxygen doxygen-clang)
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Analysis/FlowSensitive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ add_custom_command(OUTPUT HTMLLogger.inc
DEPENDS ${CLANG_SOURCE_DIR}/utils/bundle_resources.py HTMLLogger.html HTMLLogger.css HTMLLogger.js
VERBATIM)
add_custom_target(clangAnalysisFlowSensitiveResources DEPENDS HTMLLogger.inc)
set_target_properties(clangAnalysisFlowSensitiveResources PROPERTIES FOLDER "Clang/Misc")
4 changes: 2 additions & 2 deletions clang/lib/Headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,14 @@ endforeach( f )
function(add_header_target target_name file_list)
add_library(${target_name} INTERFACE ${file_list})
set_target_properties(${target_name} PROPERTIES
FOLDER "Misc"
FOLDER "Clang/Resources"
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
endfunction()

# The catch-all clang-resource-headers target
add_library(clang-resource-headers INTERFACE ${out_files})
set_target_properties("clang-resource-headers" PROPERTIES
FOLDER "Misc"
FOLDER "Clang/Resources"
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
add_dependencies("clang-resource-headers"
"core-resource-headers"
Expand Down
5 changes: 2 additions & 3 deletions clang/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ configure_file(AST/gen_ast_dump_json_test.py
${CLANG_BINARY_DIR}/bin/gen_ast_dump_json_test.py COPYONLY)

add_custom_target(clang-test-depends DEPENDS ${CLANG_TEST_DEPS})
set_target_properties(clang-test-depends PROPERTIES FOLDER "Clang tests")
set_target_properties(clang-test-depends PROPERTIES FOLDER "Clang/Tests")

add_lit_testsuite(check-clang "Running the Clang regression tests"
${CMAKE_CURRENT_BINARY_DIR}
Expand All @@ -179,7 +179,6 @@ add_lit_testsuite(check-clang "Running the Clang regression tests"
DEPENDS ${CLANG_TEST_DEPS}
ARGS ${CLANG_TEST_EXTRA_ARGS}
)
set_target_properties(check-clang PROPERTIES FOLDER "Clang tests")

add_lit_testsuites(CLANG ${CMAKE_CURRENT_SOURCE_DIR}
PARAMS ${CLANG_TEST_PARAMS}
Expand All @@ -190,7 +189,7 @@ add_lit_testsuites(CLANG ${CMAKE_CURRENT_SOURCE_DIR}
# Add a legacy target spelling: clang-test
add_custom_target(clang-test)
add_dependencies(clang-test check-clang)
set_target_properties(clang-test PROPERTIES FOLDER "Clang tests")
set_target_properties(clang-test PROPERTIES FOLDER "Clang/Tests")

# FIXME: This logic can be removed once all buildbots have moved
# debuginfo-test from clang/test to llvm/projects or monorepo.
Expand Down
2 changes: 1 addition & 1 deletion clang/tools/libclang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ install(DIRECTORY ../../include/clang-c
# component and an install-component target, so add a dummy libclang-headers
# target to allow using it in LLVM_DISTRIBUTION_COMPONENTS.
add_custom_target(libclang-headers)
set_target_properties(libclang-headers PROPERTIES FOLDER "Misc")
set_target_properties(libclang-headers PROPERTIES FOLDER "Clang/Resources")

if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-libclang-headers
Expand Down
2 changes: 1 addition & 1 deletion clang/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_custom_target(ClangUnitTests)
set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang tests")
set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang/Tests")

if(CLANG_BUILT_STANDALONE)
# LLVMTesting* libraries are needed for some of the unittests.
Expand Down
2 changes: 1 addition & 1 deletion clang/utils/ClangVisualizers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if (LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION)
set(CLANG_VISUALIZERS clang.natvis)
add_custom_target(ClangVisualizers SOURCES ${CLANG_VISUALIZERS})
set_target_properties(ClangVisualizers PROPERTIES FOLDER "Utils")
set_target_properties(ClangVisualizers PROPERTIES FOLDER "Clang/Misc")
endif()
2 changes: 0 additions & 2 deletions clang/utils/TableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ add_tablegen(clang-tblgen CLANG
)

target_link_libraries(clang-tblgen PRIVATE clangSupport_tablegen)

set_target_properties(clang-tblgen PROPERTIES FOLDER "Clang tablegenning")
2 changes: 1 addition & 1 deletion clang/utils/hmaptool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
install(PROGRAMS hmaptool DESTINATION "${CLANG_TOOLS_INSTALL_DIR}" COMPONENT hmaptool)
add_custom_target(hmaptool ALL DEPENDS "hmaptool")
set_target_properties(hmaptool PROPERTIES FOLDER "Utils")
set_target_properties(hmaptool PROPERTIES FOLDER "Clang/Utils")

if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets("install-hmaptool"
Expand Down
Loading