Clang-cl ... with objective-c?

Hey everyone.

I am working on a project in which I would like to prefferabily use Objective-C. However, cl.exe obviously does not know what a .m or .mm file is (therefore it knows CSharp, which Clang does not know…). So I wanted to ask, if the cl driver (clang-cl) actually does Objective-C too? I was going to utilize the ObjFW project as library and runtime, so I wouldn’t even need anything else but a proper ObjC compiler.

My current platform is Mac OS X, my alternative is Windows 8.1. Due to a mishap, I currently have to reinstall and re-manage my various copies of Visual Studio…but I used VC 2013.

Kind regards, Ingwie.

Hi Kevin,

I am working on a project in which I would like to prefferabily use Objective-C. However, cl.exe obviously does not know what a .m or .mm file is (therefore it knows CSharp, which Clang does not know…). So I wanted to ask, if the cl driver (clang-cl) actually does Objective-C too? I was going to utilize the ObjFW project as library and runtime, so I wouldn’t even need anything else but a proper ObjC compiler.

The goal of clang-cl is to be a driver mode that's command-line
compatible with cl.exe. Since cl.exe doesn't support Objective-C, it's
not clear what it would mean to support that in a cl.exe compatible
way.

Having said that, if you pass a .m file to clang-cl, it will probably
try to compile it as Cbjective-C, more by luck than by design. I have
no idea if the code that it produces is usable, though. I certainly
wouldn't rely on it for any real project.

I don't know much about Objective-C, especially on Windows. But why do
you want to use clang-cl instead of just regular clang?

Thanks,
Hans