Skip to content

Commit

Permalink
build: complete the changes from apple#423
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
compnerd committed Mar 15, 2022
1 parent 7dd164a commit c4bc20b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
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)

Expand Down

0 comments on commit c4bc20b

Please sign in to comment.