compiling Objective-C++ (.mm) files with clang++ on MacOS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

compiling Objective-C++ (.mm) files with clang++ on MacOS

Eliot Miranda-2
 
Hi All,

    anyone know if there's a special -x argument for clang++ when compiling .mm files?
I'm suffering from a conflict between the boost C++ libraries use of noexcept and Objective-C's use of noexcept as a keyword.  It may be that I'm invoking clang++ wrongly.  But if I use either

      clang++ -x objc
or
      clang++ -x objc++
both are rejected "language not recognized".  I can't find a list of acceptable language names (the man page just says -x <language>           Treat subsequent input files as having type <language>

_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: compiling Objective-C++ (.mm) files with clang++ on MacOS

Ben Coman
 
On Tue, 23 Apr 2019 at 03:12, Eliot Miranda <[hidden email]> wrote:

>
>
> Hi All,
>
>     anyone know if there's a special -x argument for clang++ when compiling .mm files?
> I'm suffering from a conflict between the boost C++ libraries use of noexcept and Objective-C's use of noexcept as a keyword.  It may be that I'm invoking clang++ wrongly.  But if I use either
>
>       clang++ -x objc
> or
>       clang++ -x objc++
> both are rejected "language not recognized".  I can't find a list of acceptable language names (the man page just says -x <language>           Treat subsequent input files as having type <language>

I didn't find a list of acceptable languages for...
     -x<language>, --language <arg>, --language=<arg>
     Treat subsequent input files as having type <language>

but there are these flags...
    -ObjC
    Treat source input files as Objective-C inputs
    -ObjC++
    Treat source input files as Objective-C++ inputs
https://clang.llvm.org/docs/ClangCommandLineReference.html

Also maybe useful...
https://github.com/llvm-mirror/clang/blob/51ca2d3ac1081b943629550a829f6b4f13467a6b/include/clang/Frontend/FrontendOptions.h#L145-L165

cheers -ben