Changes between Initial Version and Version 1 of Ticket #1148


Ignore:
Timestamp:
Feb 4, 2012, 2:09:03 AM (12 years ago)
Author:
historic_bruno
Comment:

Oops, ignore the bit about PCH, I just renamed my .m file to .mm and it gets detected as Objective-C++ and compiles fine (also fixes the warnings about certain flags being C++ specific). So just the trivial change is left, I'll commit it soon :)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1148 – Description

    initial v1  
    11While working on #1145, I noticed there are problems building Objective-C/C++ code, used for the Cocoa API on OS X. Until now this hasn't been a problem, but I do need to write some Obj-C to solve that ticket. Premake supports Obj-C source files (`*.m`, `*.mm`) and GCC is capable of compiling them, so I think the problem is how we're using Premake.
    22
    3 The first issue is `*.m` and `*.mm` files are not being picked up when Premake searches for files to include in the project. That doesn't seem too difficult to fix, I just modified one line of `premake4.lua`. The other problem is that the C++ precompiled headers are automatically getting included in the Objective-C source, which is bad, many of the libraries can't be compiled in Obj-C and we don't need them, so we shouldn't even try that. I don't think we'll have enough Obj-C code that we'll need precompiled headers just for them, so maybe we can leave PCH out entirely for Obj-C source files?
     3The first issue is `*.m` and `*.mm` files are not being picked up when Premake searches for files to include in the project. That doesn't seem too difficult to fix, I just modified one line of `premake4.lua`. ~~The other problem is that the C++ precompiled headers are automatically getting included in the Objective-C source, which is bad, many of the libraries can't be compiled in Obj-C and we don't need them, so we shouldn't even try that. I don't think we'll have enough Obj-C code that we'll need precompiled headers just for them, so maybe we can leave PCH out entirely for Obj-C source files?~~
    44
    5 I manually edited the Makefile and removed the PCH bits for my one Obj-C source file, everything compiled and ran fine, so we're tantalizingly close to supporting this :)
     5~~I manually edited the Makefile and removed the PCH bits for my one Obj-C source file~~, everything compiled and ran fine, so we're tantalizingly close to supporting this :)