Skip to content

Commit 9781570

Browse files
committed
Throw error if sources contain main.c
1 parent ee8d85f commit 9781570

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Sources/Transmute/Error.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ extension Module {
2727
public enum Error: ErrorType {
2828
case NoSources(String)
2929
case MixedSources(String)
30+
case CExecutableNotSupportedYet(String) //TODO: Remove this when add Support for C Exectuable
3031
}
3132
}

Sources/Transmute/Package+modules.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ extension Package {
9090
if isSwiftModule {
9191
return SwiftModule(name: name, sources: sources)
9292
}
93+
94+
//FIXME: Support executables for C languages
95+
guard !cSources.contains({ $0.hasSuffix("main.c") }) else { throw Module.Error.CExecutableNotSupportedYet(path) }
96+
9397
return ClangModule(name: name, sources: sources)
9498
}
9599

0 commit comments

Comments
 (0)