aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-06-22 12:47:56 +0200
committerJakub Konka <kubkon@jakubkonka.com>2021-06-24 18:56:56 +0200
commit3f57468c8bd16f33b5ac21cf8eaea2fdb948b999 (patch)
tree05e56ffe8ab7654813388507c9034564d80527b6 /src/main.zig
parent52a9d3f03797f1cd387ec5f2c2a1714e1121cdab (diff)
downloadzig-3f57468c8bd16f33b5ac21cf8eaea2fdb948b999.tar.gz
zig-3f57468c8bd16f33b5ac21cf8eaea2fdb948b999.zip
Classify .m as ObjC, compile using clang and link with zld
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig
index f2d00c47bb..1cf62c011b 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -290,6 +290,7 @@ const usage_build_generic =
\\ .c C source code (requires LLVM extensions)
\\ .cpp C++ source code (requires LLVM extensions)
\\ Other C++ extensions: .C .cc .cxx
+ \\ .m Objective-C source code (requires LLVM extensions)
\\
\\General Options:
\\ -h, --help Print this help and exit
@@ -1072,7 +1073,7 @@ fn buildOutputType(
.object, .static_library, .shared_library => {
try link_objects.append(arg);
},
- .assembly, .c, .cpp, .h, .ll, .bc => {
+ .assembly, .c, .cpp, .h, .ll, .bc, .m => {
try c_source_files.append(.{
.src_path = arg,
.extra_flags = try arena.dupe([]const u8, extra_cflags.items),
@@ -1135,7 +1136,7 @@ fn buildOutputType(
.positional => {
const file_ext = Compilation.classifyFileExt(mem.spanZ(it.only_arg));
switch (file_ext) {
- .assembly, .c, .cpp, .ll, .bc, .h => try c_source_files.append(.{ .src_path = it.only_arg }),
+ .assembly, .c, .cpp, .ll, .bc, .h, .m => try c_source_files.append(.{ .src_path = it.only_arg }),
.unknown, .shared_library, .object, .static_library => {
try link_objects.append(it.only_arg);
},