• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XCode and error messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode and error messages


  • Subject: Re: XCode and error messages
  • From: Jonas Maebe <email@hidden>
  • Date: Thu, 10 Aug 2006 10:49:22 +0200


On 9 aug 2006, at 23:28, Tommy Nordgren wrote:

When writing custom development tools, exactly how should error messages be formatted,
so that XCode can parse and display them?

a) error/warning messages produced by a custom build rule are never picked up properly by Xcode (rdar://problem/4343667)
b) error/warning messages produced by a "Run Script" phase are picked up by Xcode if they conform to gcc's error/warning message formatting, although the exact regex they have to conform to is not public. This means that you have to watch out when giving more info than gcc -- e.g., we also give the column in which the error occurs, but the extra colon resulting from that seemed to break Xcode's parsing (so now I replace that colon with a dash).


To work around a), you can do something like I do in the Free Pascal project templates, available from
ftp://ftp.freepascal.org/pub/fpc/beta/2.0.4-rc3/powerpc-macosx/fpc- xcode-2.0.4-rc3.dmg


Basically, I create a dummy target which contains all the source files. In the custom build rule for my source files I write out the file names of all these files to a temporary file. Then, in the main target (which is dependent on this dummy target), I have a Run Script phase which reads these file names back from that temporary file and does the actual compilation (so error messages are picked up by Xcode).

Note that the Run Script phase only compiles to assembler and not to object code. In the same main target with the Run Script phase, there is also a "custom build rule" for the Pascal source files which does nothing, but sets the output file to "$(PROJECT_DERIVED_FILE_DIR)/$ (INPUT_FILE_BASE).s" (which has been produced during the preceding Run Script phase already). Xcode will then do the assembling for you.

The reason is that Xcode will only link in object files is allowed to assemble itself. If you do it yourself and specify an object file as output, Xcode ignores it (didn't file a bug for that yet).

You can probably ignore the "fpcrtl" target from those templates; it just creates a static library from all installed Run Time Library object files for Xcode to be able to link it in easily.


Jonas _______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >XCode and error messages (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: Re: Xcode 2.4 or 2.3?
  • Next by Date: dyld crash on my intel version of my application
  • Previous by thread: XCode and error messages
  • Next by thread: i386 assembler changed in XCode 2.4?
  • Index(es):
    • Date
    • Thread