[MacPorts] #41321: cmake: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)

MacPorts noreply at macports.org
Sat Apr 5 09:34:34 PDT 2014


#41321: cmake: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or
later)
---------------------------+-----------------------
  Reporter:  ryandesign@…  |      Owner:  css@…
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.2.99
Resolution:                |   Keywords:  mavericks
      Port:  cmake         |
---------------------------+-----------------------

Comment (by nicos@…):

 Hello, I had a go at trying to build kde ports with Macports trunk, in
 order to reproduce the issue above. Even though some of the things I found
 are slightly repetitive from before or potentially naive, I thought it
 could be good to list things again, as there were some wrong leads evoked
 in the ticket, partly because of me.

 1. As is, kdelibs4 with trunk fails with cmake complaining about
 -fvisibility=hidden. As suggested by Ryan, it seems to be because of
 -stdlib being set while cmake does not recognise the option as it is not
 aware of the MacOS SDK version. This seems to happen because
 CMAKE_OSX_DEPLOYMENT_TARGET is set to "".

 Apparently, from what follows, both CMAKE_OSX_DEPLOYMENT_TARGET and
 CMAKE_OSX_SYSROOT must be set correctly to have the build proceed
 properly.

 2. When using only the patch for cmake-1.0.tcl from this ticket (i.e.
 setting -DCMAKE_OSX_DEPLOYMENT_TARGET="10.9" for Mavericks for example),
 it still fails with the error:
 {{{
 CMake Error at
 /Users/nicos/opt/share/cmake-2.8/Modules/Platform/Darwin.cmake:211
 (message):
   CMAKE_OSX_DEPLOYMENT_TARGET is '10.9' but CMAKE_OSX_SYSROOT:

    "/"

   is not set to a MacOSX SDK with a recognized version.  Either set
   CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
   empty.
 }}}
     which brings back to some known complains of cmake.

 3. When using the *two* patches of Ryan (i.e. cmake-1.0.tcl patch as
 before, but also the patch to portconfigure.tcl to set SYSROOT), the build
 then works. So that I would disagree with Marko, as it seems to solve the
 issue for me.

 4. When avoiding to set both CMAKE_OSX_SYSROOT and
 CMAKE_OSX_DEPLOYMENT_TARGET (as it was performed in r101169), the build
 works. However, the comment in r101420 seems to indicate that it is not a
 good solution to have cmake find the SDK by itself, even though I am not
 fully clear why.

 4. I had also tried to set CMAKE_OSX_SYSROOT manually at the level of the
 cmake portgroup, by using the command
 {{{
 xcodebuild -sdk macosx -version Path
 }}}
     instead of the more manual way of your patch for portconfigure.tcl
 (patch for cmake portgroup attached). In this case too, the build goes
 fine. I am aware that using a system call to xcodebuild is not ideal, but
 this shows that the build can also work by setting CMAKE_OSX_SYSROOT
 correctly at the level of cmake-1.0.tcl.

 From all this, it seems that the problem can be solved with your two
 patches, Ryan (thanks a lot for that). But if the patch of #41783 causes
 other issues, I am wondering if it would not be also a solution to set
 CMAKE_OSX_SYSROOT in the cmake portgroup with the code snippet of
 portconfigure.tcl. In this case, the problem could perhaps be solved while
 not generating others: the -isysroot option which breaks FSF GCC is not
 employed when just setting CMAKE_OSX_SYSROOT, although there may be other
 issues.

-- 
Ticket URL: <https://trac.macports.org/ticket/41321#comment:23>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list