SwiftMix: properly export SwiftMain method

This commit is contained in:
Gregor Jasny 2019-05-01 13:24:34 +02:00
parent cab5471a7b
commit b7b66919a3
2 changed files with 2 additions and 1 deletions

View File

@ -3,3 +3,4 @@ project(SwiftMix C Swift)
add_executable(SwiftMix CMain.c ObjCMain.m SwiftMain.swift ObjC-Swift.h)
set_property(TARGET SwiftMix PROPERTY XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER "ObjC-Swift.h")
target_compile_options(SwiftMix PRIVATE "$<$<COMPILE_LANGUAGE:C>:-Werror=objc-method-access>")

View File

@ -1,7 +1,7 @@
import Foundation
@objc class SwiftMainClass : NSObject {
class func SwiftMain() -> Int32 {
@objc class func SwiftMain() -> Int32 {
dump("Hello World!");
return 0;
}