Skip to content

Commit

Permalink
build: complete the changes from #423 (#425)
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.

Authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
  • Loading branch information
compnerd committed Mar 16, 2022
1 parent 777930b commit b054991
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 b054991

Please sign in to comment.