[MacPorts] #53201: cmake: doesn't recognize macports-clang (No known features for CXX compiler)

MacPorts noreply at macports.org
Wed May 24 13:43:14 UTC 2017


#53201: cmake: doesn't recognize macports-clang (No known features for CXX
compiler)
---------------------+-----------------------
  Reporter:  RJVB    |      Owner:  michaelld
      Type:  defect  |     Status:  assigned
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:  cmake   |
---------------------+-----------------------

Comment (by RJVB):

 Seems my hunch is correct:

 1. AppleClang-C[XX].cmake is included when using a recognised Apple system
 Xcode compiler using an Apple LLVM versioning scheme
 2. Clang-C[XX].cmake is included otherwise.

 2) also applies to the Clang compilers provided by Xcode 3.2.6 and 4.2,
 i.e. the system Clang compilers on 10.6 (and earlier, undoubtedly), but
 that's because they identify themselves as as stock Clang compilers.

 To summarise, I think this was a storm in a glass of water and a false
 alarm in the end. The patch I attached should be safe from what I can tell
 (= never interfere with feature determination of the system compiler).

 If ever you do run into such an issue we can take additional measures but
 I think we can and should rely on the KitWare guys having done their
 homework "how to detect AppleClang".

 What we can do is add an option that a) is less ugly than the policy
 option and b) not affected by what the project's cmake files do in terms
 on minimal required version, policy setting etc. For instance (in Clang-
 CXX-cmake):

 {{{
 cmake_policy(GET CMP0025 appleClangPolicy)
 option(CMAKE_CXX_REJECT_NON_APPLECLANG "Reject Clang++ other than
 AppleClang++ on Mac unless Policy 25 is set to NEW" OFF)
 if(APPLE AND CMAKE_CXX_REJECT_NON_APPLECLANG AND NOT appleClangPolicy
 STREQUAL NEW)
   return()
 endif()
 }}}

 This has the same effect as my earlier patch, but makes it possible to
 revert to CMake's stock behaviour by adding
 `-DCMAKE_CXX_REJECT_NON_APPLECLANG=ON` to the commandline.

--
Ticket URL: <https://trac.macports.org/ticket/53201#comment:14>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list