[MacPorts] #44125: cmake needs to support building against / with a deployment target set (prevents libc++ support on Snow Leopard for cmake projects)
MacPorts
noreply at macports.org
Mon Jul 21 01:36:41 PDT 2014
#44125: cmake needs to support building against / with a deployment target set
(prevents libc++ support on Snow Leopard for cmake projects)
---------------------------+--------------------------------
Reporter: mojca@… | Owner: macports-tickets@…
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: fixed | Keywords:
Port: cmake libcxx |
---------------------------+--------------------------------
Comment (by mojca@…):
Replying to [comment:15 jeremyhu@…]:
>
> > On the other hand I understand that setting target to 10.6 on 10.7
without specifying the SDK might render the resulting binary useless on
10.6.
>
> Why do you say that? The whole point of setting the deployment target
to 10.6 means that the resulting binary will work on 10.6 unless there's a
bug in the toolchain for some reason (which setting the sysroot won't
solve).
My personal experience is that setting just `-mmacosx-version-min=10.x`
isn't always enough to get functional binaries. Sometimes it works, but
often one also needs to set other variables. For compiling TeX binaries
I'm currently using the following variables for example:
{{{
export arch=i386
export MYLDFLAGS="-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib"
export MYSYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-
version-min=10.5"
export CFLAGS="-arch $arch $MYSYSROOT"
export CXXFLAGS="-arch $arch $MYSYSROOT"
export OBJCFLAGS="-arch $arch $MYSYSROOT"
export OBJCXXFLAGS="-arch $arch $MYSYSROOT"
export LDFLAGS="-arch $arch $MYLDFLAGS $MYSYSROOT"
}}}
Maybe having both `-L/Developer/SDKs/MacOSX10.5.sdk/usr/lib` and
`-isysroot /Developer/SDKs/MacOSX10.5.sdk` is too much. But just
`-mmacosx-version-min=10.5` certainly wasn't enough. The binaries kept
crashing on 10.5 if I didn't set the `isysroot`. (But I no longer have a
10.5 machine to repeat the experiment.)
There is also "hardcoded" SDK in
[browser:trunk/dports/graphics/wxWidgets-2.8/Portfile wxWidgets-2.8] (see
also the [browser:trunk/dports/_resources/port1.0/group/wxWidgets-1.0.tcl
wxWidgets PortGroup]). From what I remember wxWidgets 2.8 doesn't compile
on 10.7 unless the SDK for 10.6 is explicitly set.
Please also leave some feedback on #41783.
--
Ticket URL: <https://trac.macports.org/ticket/44125#comment:17>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list