Skip to content

Support building Objective-C modules #181

Closed
@bos

Description

@bos

(Imported from Trac #188, reported by guest on 2007-12-09)

GHC ignores Objective C sources unless -x c is passed to it on the command line before the source files.
As far as I could tell there is no way to pass that option to GHC through Cabal so no .m files ever get built (well.. not completely true - setting ghc-options works but that breaks compilation of Haskell code).

One way to get this to work would be to just add some extra code in Cabal to automatically pass -x c for .m files. This is probably a bad idea as someone might want or need to compile files using some other extension at some point.

Another option is add some way of specifying compile options on a per-file (or group of files) basis: setting ghc-options to -x c just for one set of files. Still very limited but it's an improvement over the first option.

Third option I can think of is to add a way of specifying compiler/extension pairs in Cabal so given compilers are automatically used to compile files with corresponding extensions.

Depending on how much time I have I might look into adding this functionality myself but would like some feedback on which approach to take.
Otherwise I might have to stick with autotools and ignore Cabal until it gets a bit more mature and flexible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions