Re: [AD] CMake on Mac OS X |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2008-09-09, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 9 Sep 2008, at 08:57, Peter Hull wrote:
> > I get this (this is the problem that's stumped me for ages, it seems
> > to be platform dependent but I don't know where that -multi_module
> > option comes from)
>
> Tell me about it. This has been haunting me for more than a year on
> another (work related) project. It appears that MacOS X is a bit
> quirky when it comes to building shared objects. It doesn't like
> global ("common") variables and it doesn't like unresolved externals
> when building the shared object.
> There are commandline switches that help, both during compilation and
> linking, but it's been a while since I looked into it. I'll have
> another go at it. I might have more luck getting it to work with
> Allegro (which doesn't include FORTRAN code as well) than I did with
> my other project (which does). Having a peek at what Allegro 4.2 does
> differently might be illuminating, but I can't make heads or tails of
> some of the CMake stuff.
> I'm guessing multi_module might be a default option.
I found this http://gcc.gnu.org/ml/gcc/2005-06/msg00186.html
and the following message.
As a hack, could someone try this:
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 10775)
+++ CMakeLists.txt (working copy)
@@ -548,6 +548,7 @@
set_target_properties(${target}
PROPERTIES
COMPILE_FLAGS "${more_extra_flags} ${LIBRARY_CFLAGS} -DALLEGRO_SRC"
+ LINK_FLAGS "-Wl,-single_module"
OUTPUT_NAME ${nam}
)