www.digitalmars.com         C & C++   DMDScript  

D.gnu - Integrating gdc and D in Xcode

reply Drew McCormack <drewmccormack mac.com> writes:
Has anyone tried to integrate D and gdc into Xcode on Mac OS X? Any success?

Drew McCormack
Apr 28 2004
next sibling parent Stephan Wienczny <wienczny web.de> writes:
It would be nice to have a kdevelop integration, too...

Drew McCormack wrote:
 Has anyone tried to integrate D and gdc into Xcode on Mac OS X? Any 
 success?
 
 Drew McCormack
 

Apr 28 2004
prev sibling parent reply bjoern <b.z. gmx.net> writes:
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I was looking into it for one evening... and I have produced the 
attached files to get syntax highlighting. You have to put them into:

(~)/Library/Application Support/Apple/Developer Tools/Specifications

And I was able to get Xcode to compile the d-Files, but not to link 
them... You can "right-click" on your target, choose "Get Info", then 
select "Rules", and add a custom rule with the following settings:

Process: <<Source with names matching:>> <<*.d>>
using: <<Custom script:>> <</usr/local/bin/gdc -c $(INPUT_FILE_PATH);
mv $(INPUT_FILE_DIR)/$(INPUT_FILE_BASE).o 
$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).o;>>
with output files: <<$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).o>>

Then you will be where I left off. If you want to work on it, you should 
definitly have a look at:

/Library/Application Support/Apple/Developer Tools/

where you will find "Project Templates". I copied the c++-Tool-Template, 
which wasn't very smart, maybe the java-tool template would have been 
better...

You can also look at the Xcode help (search for "configuring a target") 
and then look at "Build Rules" for infos on how a script could work...

Good luck,
- Bjoern

Drew McCormack wrote:
 Has anyone tried to integrate D and gdc into Xcode on Mac OS X? Any 
 success?
 
 Drew McCormack
 

Apr 28 2004
parent Brian Chapman <nospam-for-brian see-post-for-address.net> writes:
 Drew McCormack wrote:
 Has anyone tried to integrate D and gdc into Xcode on Mac OS X? Any success?
 
 Drew McCormack


On 2004-04-28 11:06:28 -0500, bjoern <b.z. gmx.net> said:
 Hi,
 
 I was looking into it for one evening... and I have produced the 
 attached files to get syntax highlighting. You have to put them into:
 
 (~)/Library/Application Support/Apple/Developer Tools/Specifications
 
 And I was able to get Xcode to compile the d-Files, but not to link 
 them... You can "right-click" on your target, choose "Get Info", then 
 select "Rules", and add a custom rule with the following settings:
 
 Process: <<Source with names matching:>> <<*.d>>
 using: <<Custom script:>> <</usr/local/bin/gdc -c $(INPUT_FILE_PATH);
 mv $(INPUT_FILE_DIR)/$(INPUT_FILE_BASE).o 
 $(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).o;>>
 with output files: <<$(DERIVED_FILES_DIR)/$(INPUT_FILE_BASE).o>>
 
 Then you will be where I left off. If you want to work on it, you 
 should definitly have a look at:
 
 /Library/Application Support/Apple/Developer Tools/
 
 where you will find "Project Templates". I copied the 
 c++-Tool-Template, which wasn't very smart, maybe the java-tool 
 template would have been better...
 
 You can also look at the Xcode help (search for "configuring a target") 
 and then look at "Build Rules" for infos on how a script could work...
 
 Good luck,
 - Bjoern


Thanks Bjoern, I tried to write my own pb{file,lang}specs but they didn't work. Yours did though. :-) I'm still using Project Builder because I don't have the cash to upgrade to 10.3 at the moment (I'm just going to go strait to 10.4 I think). Anyway, have you guys tried using a custom Makefile? It works for me. In PB, you start a new Empty Project and then create a new build target called a "Legacy Makefile." In Xcode, I think it's more aptly called "GNU Makefile." I haven't tried the debugger yet, but I've heard some people are having problems setting breakpoints. I'd say try putting a call to raise(SIGTRAP) before the line in question and see if that works. I might put together a sample project if anyone is interested. Xcode will still load PB projects IIRC. The only problem with this method is that you have to know how to write Makefiles. That's not a problem for me, but it could be for some. O'Reilly has a good book on 'make' though. It's what I learned from. Cheers, Brian
Nov 23 2004