mirror of
https://github.com/apple/swift-argument-parser.git
synced 2026-06-06 20:18:23 +00:00
This adds `-parse-as-library` to the example targets which use `@main` resulting in a compile failure as `@main` is not processed unless the target is marked as library. Authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
21 lines
472 B
CMake
21 lines
472 B
CMake
add_executable(math
|
|
math/Math.swift)
|
|
target_compile_options(math PRIVATE
|
|
-parse-as-library)
|
|
target_link_libraries(math PRIVATE
|
|
ArgumentParser
|
|
$<$<STREQUAL:${CMAKE_SYSTEM_NAME},Linux>:m>)
|
|
|
|
add_executable(repeat
|
|
repeat/Repeat.swift)
|
|
target_compile_options(repeat PRIVATE
|
|
-parse-as-library)
|
|
target_link_libraries(repeat PRIVATE
|
|
ArgumentParser)
|
|
|
|
add_executable(roll
|
|
roll/main.swift
|
|
roll/SplitMix64.swift)
|
|
target_link_libraries(roll PRIVATE
|
|
ArgumentParser)
|