Issue #796 resolved

Allow OS X builds to use non-framework dependencies

created an issue

The LÖVE source code assumes that, on OS X, dependencies such as freetype, devil, libsdl, etc, are built as OS X frameworks. This is not necessarily the case. Those projects don't build that way usually; it takes manual effort to get them to build as frameworks. In MacPorts, these dependencies are installed as normal libraries, just as they would be on e.g. Linux.

For example, src/modules/filesystem/physfs/File.h says, in part:

// PhysFS
#ifdef LOVE_MACOSX // wacky Mac behavior means different #include syntax!
#include <physfs/physfs.h>
#include <physfs.h>

It's not "wacky Mac behavior"; it's how OS X frameworks are designed to work. But there's no particular reason to require the dependencies to be frameworks, and for my purposes of wanting to make LÖVE available in MacPorts, I don't have or want frameworks. So I've been having to patch these files, e.g. as follows:

--- src/modules/filesystem/physfs/File.h.orig   2013-11-05 23:50:54.000000000 -0600
+++ src/modules/filesystem/physfs/File.h    2013-11-07 20:56:59.000000000 -0600
@@ -25,11 +25,7 @@
 #include "filesystem/File.h"

 // PhysFS
-#ifdef LOVE_MACOSX // wacky Mac behavior means different #include syntax!
-#include <physfs/physfs.h>
 #include <physfs.h>

 // STD
 #include <string>

I'd like to request a new flag that could be used to indicate whether one wants to use dependencies built as frameworks or dependencies built as normal libraries, distinct from the existing LOVE_MACOSX flag which is also used for unrelated OS X-specific things. The existing Xcode project could default that flag to on if you like to preserve the previous behavior, while the autotools build, which didn't work on OS X at all until a few days ago anyway so I don't think changing it would affect existing Mac users, could default to off.

Comments (1)

  1. Log in to comment