The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 Re: Main Forum » Compile on Mac » 2014-02-20 17:53:11

mps

Thanks!  I had seen the makeDistributionMacOSX script but had not tried it yet.

Here's a diff to apply to the current version (as I write, 33) to get it to compile on OSX Mavericks with Homebrew SDL:

https://gist.github.com/cokernel/9126596

The clang compiler was originally an internal Apple project.  Between 10.6 and 10.9, OSX phased out gcc in favor of clang.  Rather than dropping debugging symbols entirely, in my diff I've replaced the GCC-specific -gstabs+ with -g in DEBUG_ON_FLAG.

It also appears that 10.9 dropped support for SDL 1.2.  So in my diff above I don't use "-framework SDL" but the linker flags I get from the copy of SDL installed with homebrew.  I can then build the Castle Doctrine with runToBuild and set up the Mac directory with

./makeDistributionMacOSX 33 mac /usr/local/lib/libSDLmain.a

to get a working game.

#2 Re: Main Forum » Compile on Mac » 2014-02-19 19:13:54

mps

The -gstabs+ flag is used to set a debugging flag.  If you are not planning on debugging the executable you build, you can disable it by commenting it out in the file minorGems/game/platform/SDL/Makefile.common.

That is, replace the line

DEBUG_ON_FLAG = -gstabs+ #-DDEBUG_MEMORY

with

DEBUG_ON_FLAG = #-gstabs+ #-DDEBUG_MEMORY

When I was compiling this, I also had to change the linker settings for SDL, dropping "-framework SDL" and adding "-L/usr/local/lib -lSDLmain -lSDL" to the definition of PLATFORM_LINK_FLAGS in the file minorGems/game/platform/SDL/Makefile.MacOSX.  My SDL setup is slightly odd, so you might not have to do this.

With these changes I was able to compile the program for OSX Mavericks using the runToBuild script.  However, I noticed that the runToBuild script does not put the game assets where the executable expects to find them.  On my build, ./CastleDoctrineApp looks for assets, settings, and so on in the parent directory instead of as sibling directories.  But adjusting for that and including my download code and email (and using the right secret), I get a playable game.

I'm sorry that this isn't more streamlined, but hopefully it will help you get a working game.

Board footer

Powered by FluxBB 1.5.8