Browse Source

SwiftMix: properly export SwiftMain method

Gregor Jasny 6 years ago
parent
commit
b7b66919a3
2 changed files with 2 additions and 1 deletions
  1. 1 0
      Tests/SwiftMix/CMakeLists.txt
  2. 1 1
      Tests/SwiftMix/SwiftMain.swift

+ 1 - 0
Tests/SwiftMix/CMakeLists.txt

@@ -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>")

+ 1 - 1
Tests/SwiftMix/SwiftMain.swift

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