Created
July 7, 2015 09:08
-
-
Save cezarywojcik/2cf9671d61a0f61c85c8 to your computer and use it in GitHub Desktop.
Compiling Swift With C Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: app | |
app: c.o s.o | |
swiftc -o app c.o s.o | |
c.o: test.h test.c | |
clang test.c -o c.o -c | |
s.o: test.swift | |
swiftc test.swift -o s.o -c -import-objc-header test.h | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void test() | |
{ | |
printf("Hello, World!\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef TEST_H | |
#define TEST_H | |
void test(); | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment