Skip to content

[swift-inspect] use CMake FetchContent to fetch ArgumentParser when not provided #78827

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 6 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
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
Next Next commit
[swift-inspect] use FetchContent to fetch ArgumentParser in CMake build
  • Loading branch information
andrurogerz committed Jan 22, 2025
commit 509a07767b1e81cfae1fd15dd963903ef2b7b4ad
12 changes: 11 additions & 1 deletion tools/swift-inspect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.28)
project(swift-inspect
LANGUAGES C CXX Swift)

include(FetchContent)

# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -12,7 +14,15 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

find_package(ArgumentParser CONFIG REQUIRED)
FetchContent_Declare(ArgumentParser
GIT_REPOSITORY https://github.com/apple/swift-argument-parser
GIT_TAG 1.5.0
GIT_SHALLOW TRUE
EXCLUDE_FROM_ALL
FIND_PACKAGE_ARGS CONFIG)
set(BUILD_TESTING OFF CACHE INTERNAL "skip building tests")
set(BUILD_EXAMPLES OFF CACHE INTERNAL "skip building examples")
FetchContent_MakeAvailable(ArgumentParser)

add_library(SymbolicationShims INTERFACE)
target_include_directories(SymbolicationShims INTERFACE
Expand Down