swiftc adds a main function consisting of top-level statements to objects generated by a swiftc invocation with a single input file, leading to duplicate symbols when linking the final executable (in case of a static library). This argument prevents this from happening, apply it to library targets automatically.pull/14267/head
parent
1b54239a88
commit
29f46bfaf5
6 changed files with 16 additions and 1 deletions
@ -0,0 +1,3 @@ |
||||
import SingleFile |
||||
|
||||
callMe() |
@ -0,0 +1,4 @@ |
||||
project('single-file library', 'swift') |
||||
|
||||
lib = static_library('SingleFile', 'singlefile.swift') |
||||
executable('program', 'main.swift', link_with: [lib]) |
@ -0,0 +1 @@ |
||||
public func callMe() {} |
@ -1 +1,3 @@ |
||||
print("test") |
||||
public func callMe() { |
||||
print("test") |
||||
} |
||||
|
Loading…
Reference in new issue