[clang] [llvm] [cmake][llvm] Limit the number of Xcode schemes created by default (PR #101243)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 30 14:51:40 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Jon Roelofs (jroelofs)
<details>
<summary>Changes</summary>
CMake -GXcode would otherwise offer to create one scheme for each target, which ends up being a lot. For now, limit the default to the `check-*` LIT targets, plus `ALL_BUILD` and `install`.
---
Full diff: https://github.com/llvm/llvm-project/pull/101243.diff
2 Files Affected:
- (modified) clang/cmake/modules/AddClang.cmake (+2)
- (modified) llvm/cmake/modules/AddLLVM.cmake (+2)
``````````diff
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index 9d09be1936847..5327b5d2f0892 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -147,6 +147,7 @@ endmacro(add_clang_library)
macro(add_clang_executable name)
add_llvm_executable( ${name} ${ARGN} )
set_clang_windows_version_resource_properties(${name})
+ set_target_properties(${name} PROPERTIES XCODE_GENERATE_SCHEME ON)
endmacro(add_clang_executable)
macro(add_clang_tool name)
@@ -181,6 +182,7 @@ macro(add_clang_tool name)
set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
endif()
endif()
+ set_target_properties(${name} PROPERTIES XCODE_GENERATE_SCHEME ON)
endmacro()
macro(add_clang_symlink name dest)
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 03f4e1f190fd9..ac47e884ac229 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1452,6 +1452,7 @@ macro(llvm_add_tool project name)
endif()
get_subproject_title(subproject_title)
set_target_properties(${name} PROPERTIES FOLDER "${subproject_title}/Tools")
+ set_target_properties(${name} PROPERTIES XCODE_GENERATE_SCHEME ON)
endmacro(llvm_add_tool project name)
macro(add_llvm_tool name)
@@ -2043,6 +2044,7 @@ function(add_lit_target target comment)
# Tests should be excluded from "Build Solution".
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)
+ set_target_properties(${target} PROPERTIES XCODE_GENERATE_SCHEME ON)
endfunction()
# Convert a target name like check-clang to a variable name like CLANG.
``````````
</details>
https://github.com/llvm/llvm-project/pull/101243
More information about the cfe-commits
mailing list