diff options
author | Brad King <brad.king@kitware.com> | 2019-05-02 13:33:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-02 13:33:33 (GMT) |
commit | 1ee21c6ec5ef783d2b960fc3e13161582cf22e10 (patch) | |
tree | 7402f686bb28801fffaf43417b357ebd24da6706 /Tests | |
parent | 3ee16ef31b78ff73d7a0c569fdb87b41f2a5e97d (diff) | |
parent | b7b66919a3952a3a2c31d659fcbe3bebf7e5887e (diff) | |
download | CMake-1ee21c6ec5ef783d2b960fc3e13161582cf22e10.zip CMake-1ee21c6ec5ef783d2b960fc3e13161582cf22e10.tar.gz CMake-1ee21c6ec5ef783d2b960fc3e13161582cf22e10.tar.bz2 |
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
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/SwiftMix/CMain.c | 6 | ||||
-rw-r--r-- | Tests/SwiftMix/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/SwiftMix/ObjCMain.m | 2 | ||||
-rw-r--r-- | Tests/SwiftMix/SwiftMain.swift | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/Tests/SwiftMix/CMain.c b/Tests/SwiftMix/CMain.c index 8877da4..519058e 100644 --- a/Tests/SwiftMix/CMain.c +++ b/Tests/SwiftMix/CMain.c @@ -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(); } diff --git a/Tests/SwiftMix/CMakeLists.txt b/Tests/SwiftMix/CMakeLists.txt index 5e50470..6d8e48b 100644 --- a/Tests/SwiftMix/CMakeLists.txt +++ b/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>") diff --git a/Tests/SwiftMix/ObjCMain.m b/Tests/SwiftMix/ObjCMain.m index 20f0bf1..afc92438 100644 --- a/Tests/SwiftMix/ObjCMain.m +++ b/Tests/SwiftMix/ObjCMain.m @@ -1,4 +1,4 @@ #import "SwiftMix-Swift.h" -int ObjCMain(int argc, char const* const argv[]) { +int ObjCMain(void) { return [SwiftMainClass SwiftMain]; } diff --git a/Tests/SwiftMix/SwiftMain.swift b/Tests/SwiftMix/SwiftMain.swift index a4a0a62..d9c8cd7 100644 --- a/Tests/SwiftMix/SwiftMain.swift +++ b/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; } |