[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur reopened 
https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-25 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur closed 
https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89743

>From afadef1f53e03e2cf3a1695f3c693913b27382dd Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:03:11 +0200
Subject: [PATCH 1/3] [clang] Revise IDE folder structure

---
 clang/CMakeLists.txt| 8 +---
 clang/bindings/python/tests/CMakeLists.txt  | 2 +-
 clang/cmake/modules/AddClang.cmake  | 3 ---
 clang/docs/CMakeLists.txt   | 1 +
 clang/lib/Analysis/FlowSensitive/CMakeLists.txt | 1 +
 clang/lib/Headers/CMakeLists.txt| 4 ++--
 clang/lib/Tooling/CMakeLists.txt| 2 ++
 clang/test/CMakeLists.txt   | 5 ++---
 clang/tools/libclang/CMakeLists.txt | 2 +-
 clang/unittests/CMakeLists.txt  | 2 +-
 clang/utils/ClangVisualizers/CMakeLists.txt | 2 +-
 clang/utils/TableGen/CMakeLists.txt | 2 --
 clang/utils/hmaptool/CMakeLists.txt | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f092766fa19f0..09da3ad9979ff 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -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)
@@ -390,7 +391,7 @@ 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
@@ -398,6 +399,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   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)
@@ -478,7 +480,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
@@ -541,7 +543,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
diff --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index c4cd2539e9d6c..2543cf739463d 100644
--- a/clang/bindings/python/tests/CMakeLists.txt
+++ b/clang/bindings/python/tests/CMakeLists.txt
@@ -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)
diff --git a/clang/cmake/modules/AddClang.cmake 
b/clang/cmake/modules/AddClang.cmake
index 75b0080f67156..a5ef639187d9d 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -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)
@@ -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)
 
diff --git a/clang/docs/CMakeLists.txt b/clang/docs/CMakeLists.txt
index 4163dd2d90ad5..51e9db29f887f 100644
--- a/clang/docs/CMakeLists.txt
+++ b/clang/docs/CMakeLists.txt
@@ -78,6 +78,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY 

[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

> Oh the fun of PR numbers now lining up with Phabricator numbers. I thought 
> you meant https://reviews.llvm.org/D89741 and was very confused until I saw 
> #89741. :-D I'll take a look!

Well, seems I still have muscle memory from Phabricator times :-)

Thanks for the review!

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-21 Thread Aaron Ballman via llvm-branch-commits

https://github.com/AaronBallman approved this pull request.

I verified the layout seems reasonable in Visual Studio 2022; LGTM!

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-21 Thread Aaron Ballman via llvm-branch-commits

AaronBallman wrote:

> @AaronBallman Would you mind reviewing D89741 ? I was convinced a stakeholder 
> there but they decided to drop out instead of approving it.

Oh the fun of PR numbers now lining up with Phabricator numbers. I thought you 
meant https://reviews.llvm.org/D89741 and was very confused until I saw 
https://github.com/llvm/llvm-project/pull/89741. :-D I'll take a look!

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-21 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

@AaronBallman Would you mind reviewing D89741 ? I was convinced a stakeholder 
there but they decided to drop out instead of approving it.

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-14 Thread Aaron Ballman via llvm-branch-commits

AaronBallman wrote:

> @AaronBallman Thanks for having a look.
> 
> > With this patch, I get errors when loading a visual studio solution 
> > generated with these change, and all of clang's libraries are placed at the 
> > top level. The error is a dialog box saying "The solution already contains 
> > an item named 'clang'."
> 
> I got similar errors with "Unittest" and "UnitTest". I only solved it by 
> using "Unit". I am assuming this is because there is something else already 
> with that name but inconsistent case. I never seen this for this for 
> "Clang"/"clang", but it could be when not all patches from the series are 
> applied. Specifically I think clang-tools-extra may use "Clang"/"clang".
> 
> > Another thing (that is existing behavior) worth noting is that at some 
> > point, we lost the ability to browse directly to files in Visual Studio. 
> > Instead of going to `Clang Libraries->clangDriver->Source 
> > Files->ToolChain.cpp`, you have to go to `Object 
> > Libraries->obj.clangDriver->Source Files->ToolChain.cpp` which is pretty 
> > strange. Your patch doesn't change this, but if we're correcting folder 
> > structure behavior, we should probably address that at the same time if we 
> > can.
> 
> This is how CMake handles object libraries. There is one target 
> `obj.clangDriver` that builds all the *.obj file, and a library that is not 
> used. The target `clangDriver` then has a dependency on `obj.clangDriver` and 
> has its *.obj files added, but not the source files. This is to be able to 
> link a static library (`clangDriver_static.a`) and a dynamic library 
> (`clangDriver.so`) at the [same 
> time](https://github.com/llvm/llvm-project/blob/ca1bd5995f6ed934f9187305190a5abfac049173/llvm/cmake/modules/AddLLVM.cmake#L547)
>  but compiling the source files just once. I don't know the reason, but in 
> contrast to other subprojects Clang uses this build mode [even when building 
> just one 
> library](https://github.com/llvm/llvm-project/blob/ca1bd5995f6ed934f9187305190a5abfac049173/clang/cmake/modules/AddClang.cmake#L102).

Ah interesting, thank you for the explanation! I know at one point in time, 
this used to generate a more obvious layout for the solution file, so I was 
surprised by the change.

> There is an exception for XCode, and we could do the same for MSVC (or add 
> the source files as non-compiled sources to make them show up like 
> `ADDITIONAL_HEADERS` ). However, for this patch series I did not intent to 
> change anything about how the build system works.

SGTM! It might be useful to explore doing that, but I don't know how many folks 
are still generating solution files these days. Personally, I use MSVC's 
integrated CMake support which has its own set of problems but tends to be 
better than using a solution file (esp in terms of compilation times).

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-13 Thread Michael Kruse via llvm-branch-commits

Meinersbur wrote:

@AaronBallman Thanks for having a look.

> With this patch, I get errors when loading a visual studio solution generated 
> with these change, and all of clang's libraries are placed at the top level. 
> The error is a dialog box saying "The solution already contains an item named 
> 'clang'."

I got similar errors with "Unittest" and "UnitTest". I only solved it by using 
"Unit". I am assuming this is because there is something else already with that 
name but inconsistent case. I never for this for "Clang"/"clang", but it could 
be when not all patches from the series are applied. Specifically I think 
clang-tools-extra may use "Clang"/"clang".

> Another thing (that is existing behavior) worth noting is that at some point, 
> we lost the ability to browse directly to files in Visual Studio. Instead of 
> going to `Clang Libraries->clangDriver->Source Files->ToolChain.cpp`, you 
> have to go to `Object Libraries->obj.clangDriver->Source 
> Files->ToolChain.cpp` which is pretty strange. Your patch doesn't change 
> this, but if we're correcting folder structure behavior, we should probably 
> address that at the same time if we can.

This is how CMake handles object libraries. There is one target 
`obj.clangDriver` that builds all the *.obj file, and a library that is not 
used. The target `clangDriver` then has a dependency on `obj.clangDriver` and 
has its *.obj files added, but not the source files. This is to be able to link 
a static library (`clangDriver_static`) and a dynamic library (`clangDriver`) 
at the [same 
time](https://github.com/llvm/llvm-project/blob/ca1bd5995f6ed934f9187305190a5abfac049173/llvm/cmake/modules/AddLLVM.cmake#L593)
 but compiling the source files just once. I don't know the reason, but in 
contrast to other subprojects Clang uses this build mode [even when building 
just one 
library](https://github.com/llvm/llvm-project/blob/ca1bd5995f6ed934f9187305190a5abfac049173/clang/cmake/modules/AddClang.cmake#L102).
 

There is an exception for XCode, and we could do the same for MSVC (or add the 
source files as `ADDITIONAL_HEADERS` to make them show up). However, for this 
patch series I did not intent to change anything about how the build system 
works.

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-07 Thread Aaron Ballman via llvm-branch-commits

https://github.com/AaronBallman commented:

With this patch, I get errors when loading a visual studio solution generated 
with these change, and all of clang's libraries are placed at the top level. 
The error is a dialog box saying "The solution already contains an item named 
'clang'."

Another thing (that is existing behavior) worth noting is that at some point, 
we lost the ability to browse directly to files in Visual Studio. Instead of 
going to `Clang Libraries->clangDriver->Source Files->ToolChain.cpp`, you have 
to go to `Object Libraries->obj.clangDriver->Source Files->ToolChain.cpp` which 
is pretty strange. Your patch doesn't change this, but if we're correcting 
folder structure behavior, we should probably address that at the same time if 
we can.

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-05-06 Thread Vlad Serebrennikov via llvm-branch-commits

Endilll wrote:

CC @AaronBallman 

https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-24 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur updated 
https://github.com/llvm/llvm-project/pull/89743

>From afadef1f53e03e2cf3a1695f3c693913b27382dd Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:03:11 +0200
Subject: [PATCH 1/2] [clang] Revise IDE folder structure

---
 clang/CMakeLists.txt| 8 +---
 clang/bindings/python/tests/CMakeLists.txt  | 2 +-
 clang/cmake/modules/AddClang.cmake  | 3 ---
 clang/docs/CMakeLists.txt   | 1 +
 clang/lib/Analysis/FlowSensitive/CMakeLists.txt | 1 +
 clang/lib/Headers/CMakeLists.txt| 4 ++--
 clang/lib/Tooling/CMakeLists.txt| 2 ++
 clang/test/CMakeLists.txt   | 5 ++---
 clang/tools/libclang/CMakeLists.txt | 2 +-
 clang/unittests/CMakeLists.txt  | 2 +-
 clang/utils/ClangVisualizers/CMakeLists.txt | 2 +-
 clang/utils/TableGen/CMakeLists.txt | 2 --
 clang/utils/hmaptool/CMakeLists.txt | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f092766fa19f07..09da3ad9979ffd 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -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)
@@ -390,7 +391,7 @@ 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
@@ -398,6 +399,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   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)
@@ -478,7 +480,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
@@ -541,7 +543,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
diff --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index c4cd2539e9d6cf..2543cf739463d9 100644
--- a/clang/bindings/python/tests/CMakeLists.txt
+++ b/clang/bindings/python/tests/CMakeLists.txt
@@ -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)
diff --git a/clang/cmake/modules/AddClang.cmake 
b/clang/cmake/modules/AddClang.cmake
index 75b0080f671564..a5ef639187d9db 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -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)
@@ -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)
 
diff --git a/clang/docs/CMakeLists.txt b/clang/docs/CMakeLists.txt
index 4163dd2d90ad5b..51e9db29f887f3 100644
--- a/clang/docs/CMakeLists.txt
+++ b/clang/docs/CMakeLists.txt
@@ -78,6 +78,7 @@ if (LLVM_ENABLE_DOXYGEN)
 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
 WORKING_DIRECTORY 

[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-24 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-analysis

Author: Michael Kruse (Meinersbur)


Changes

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the Clang part. See #89153 for the entire series and 
motivation.

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/89743.diff


13 Files Affected:

- (modified) clang/CMakeLists.txt (+5-3) 
- (modified) clang/bindings/python/tests/CMakeLists.txt (+1-1) 
- (modified) clang/cmake/modules/AddClang.cmake (-3) 
- (modified) clang/docs/CMakeLists.txt (+1) 
- (modified) clang/lib/Analysis/FlowSensitive/CMakeLists.txt (+1) 
- (modified) clang/lib/Headers/CMakeLists.txt (+2-2) 
- (modified) clang/lib/Tooling/CMakeLists.txt (+2) 
- (modified) clang/test/CMakeLists.txt (+2-3) 
- (modified) clang/tools/libclang/CMakeLists.txt (+1-1) 
- (modified) clang/unittests/CMakeLists.txt (+1-1) 
- (modified) clang/utils/ClangVisualizers/CMakeLists.txt (+1-1) 
- (modified) clang/utils/TableGen/CMakeLists.txt (-2) 
- (modified) clang/utils/hmaptool/CMakeLists.txt (+1-1) 


``diff
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f092766fa19f07..09da3ad9979ffd 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -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)
@@ -390,7 +391,7 @@ 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
@@ -398,6 +399,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   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)
@@ -478,7 +480,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
@@ -541,7 +543,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
diff --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index c4cd2539e9d6cf..2543cf739463d9 100644
--- a/clang/bindings/python/tests/CMakeLists.txt
+++ b/clang/bindings/python/tests/CMakeLists.txt
@@ -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)
diff --git a/clang/cmake/modules/AddClang.cmake 
b/clang/cmake/modules/AddClang.cmake
index 75b0080f671564..a5ef639187d9db 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -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()
 

[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-24 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur ready_for_review 
https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur edited 
https://github.com/llvm/llvm-project/pull/89743
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang] Revise IDE folder structure (PR #89743)

2024-04-23 Thread Michael Kruse via llvm-branch-commits

https://github.com/Meinersbur created 
https://github.com/llvm/llvm-project/pull/89743

Reviewers of #89153 suggested to break up the patch into per-subproject 
patches. This is the Clang part. See #89153 for the entire series and 
motivation.

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  PROPERTY FOLDER 
"")`) 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.


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  PROPERTY FOLDER 
"")`) 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.


>From afadef1f53e03e2cf3a1695f3c693913b27382dd Mon Sep 17 00:00:00 2001
From: Michael Kruse 
Date: Tue, 23 Apr 2024 13:03:11 +0200
Subject: [PATCH] [clang] Revise IDE folder structure

---
 clang/CMakeLists.txt| 8 +---
 clang/bindings/python/tests/CMakeLists.txt  | 2 +-
 clang/cmake/modules/AddClang.cmake  | 3 ---
 clang/docs/CMakeLists.txt   | 1 +
 clang/lib/Analysis/FlowSensitive/CMakeLists.txt | 1 +
 clang/lib/Headers/CMakeLists.txt| 4 ++--
 clang/lib/Tooling/CMakeLists.txt| 2 ++
 clang/test/CMakeLists.txt   | 5 ++---
 clang/tools/libclang/CMakeLists.txt | 2 +-
 clang/unittests/CMakeLists.txt  | 2 +-
 clang/utils/ClangVisualizers/CMakeLists.txt | 2 +-
 clang/utils/TableGen/CMakeLists.txt | 2 --
 clang/utils/hmaptool/CMakeLists.txt | 2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f092766fa19f07..09da3ad9979ffd 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -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)
@@ -390,7 +391,7 @@ 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
@@ -398,6 +399,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   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)
@@ -478,7 +480,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
@@ -541,7 +543,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
diff --git a/clang/bindings/python/tests/CMakeLists.txt 
b/clang/bindings/python/tests/CMakeLists.txt
index c4cd2539e9d6cf..2543cf739463d9 100644
---