[CMake] Polish folders in generated Xcode project
authorStefan Granitz <stefan.graenitz@gmail.com>
Thu, 18 Jul 2019 16:44:45 +0000 (16:44 +0000)
committerStefan Granitz <stefan.graenitz@gmail.com>
Thu, 18 Jul 2019 16:44:45 +0000 (16:44 +0000)
Summary: Group plugins by subfolder. Move liblldb-resource-headers to `lldb misc`. Avoid install-distribution related targets in IDE-enabled builds.

Reviewers: jingham, mib, stella.stamenova

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64865

llvm-svn: 366459

lldb/CMakeLists.txt
lldb/cmake/modules/AddLLDB.cmake
lldb/cmake/modules/LLDBFramework.cmake

index 609aa0b..a963ed6 100644 (file)
@@ -234,6 +234,6 @@ if (NOT LLDB_DISABLE_PYTHON)
     endif ()
 endif ()
 
-if(LLDB_BUILT_STANDALONE)
+if(LLDB_BUILT_STANDALONE AND NOT LLVM_ENABLE_IDE)
   llvm_distribution_add_targets()
 endif()
index 4c99278..d8fc1ab 100644 (file)
@@ -122,7 +122,11 @@ function(add_lldb_library name)
   target_compile_options(${name} PRIVATE ${PARAM_EXTRA_CXXFLAGS})
 
   if(PARAM_PLUGIN)
-    set_target_properties(${name} PROPERTIES FOLDER "lldb plugins")
+    get_property(parent_dir DIRECTORY PROPERTY PARENT_DIRECTORY)
+    if(EXISTS ${parent_dir})
+      get_filename_component(category ${parent_dir} NAME)
+      set_target_properties(${name} PROPERTIES FOLDER "lldb plugins/${category}")
+    endif()
   else()
     set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
   endif()
index f5f3cd4..7a00ec4 100644 (file)
@@ -78,6 +78,7 @@ endforeach()
 
 # Wrap output in a target, so lldb-framework can depend on it.
 add_custom_target(liblldb-resource-headers DEPENDS ${lldb_staged_headers})
+set_target_properties(liblldb-resource-headers PROPERTIES FOLDER "lldb misc")
 add_dependencies(liblldb liblldb-resource-headers)
 
 # At build time, copy the staged headers into the framework bundle (and do