Skip to content
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

[cmake][llvm] Limit the number of Xcode schemes created by default #101243

Merged
merged 7 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/cmake/modules/AddClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions lldb/cmake/modules/AddLLDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ function(add_lldb_tool name)
endif()

add_lldb_executable(${name} GENERATE_INSTALL ${ARG_UNPARSED_ARGUMENTS})
set_target_properties(${name} PROPERTIES XCODE_GENERATE_SCHEME ON)
endfunction()

# The test suite relies on finding LLDB.framework binary resources in the
Expand Down
13 changes: 13 additions & 0 deletions llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1423,3 +1423,16 @@ endif()
if (LLVM_INCLUDE_UTILS AND LLVM_INCLUDE_TOOLS)
add_subdirectory(utils/llvm-locstats)
endif()

if (XCODE)
# For additional targets that you would like to add schemes, specify e.g:
#
# -DLLVM_XCODE_EXTRA_TARGET_SCHEMES="TargetParserTests;SupportTests"
#
# at CMake configure time.
set(LLVM_XCODE_EXTRA_TARGET_SCHEMES "" CACHE STRING "Specifies an extra list of targets to turn into schemes")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to say "an extra list of semi colon separated target names"? Do you specify this multiple times, or just once with semi colon separated target names?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lists in CMake are semicolon-separated. I'll add an example in a comment.


foreach(target ${LLVM_XCODE_EXTRA_TARGET_SCHEMES})
set_target_properties(${target} PROPERTIES XCODE_GENERATE_SCHEME ON)
endforeach()
endif()
2 changes: 2 additions & 0 deletions llvm/cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
Loading