Merge topic 'fix-swiftmix-test-for-xcode-10.2'

b7b66919a3 SwiftMix: properly export SwiftMain method
cab5471a7b SwiftMix: Get rid of pointer types mismatch warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3279
This commit is contained in:
Brad King
2019-05-02 13:33:23 +00:00
committed by Kitware Robot
4 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
extern int ObjCMain(int argc, char const* const argv[]);
int main(int argc, char* argv[])
extern int ObjCMain(void);
int main(void)
{
return ObjCMain(argc, argv);
return ObjCMain();
}
+1
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>")
+1 -1
View File
@@ -1,4 +1,4 @@
#import "SwiftMix-Swift.h"
int ObjCMain(int argc, char const* const argv[]) {
int ObjCMain(void) {
return [SwiftMainClass SwiftMain];
}
+1 -1
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;
}