[cmake-developers] cmake fails to identify C and CXX compiler when building universal

Nils Gladitz nilsgladitz at gmail.com
Tue Sep 29 02:54:01 EDT 2015


On 09/29/2015 04:38 AM, Ryan Schmidt wrote:
> Hello, I am a developer with the MacPorts package management system, and I want to report to you a bug in cmake 3.3.2 that affects OS X.
>
> I was going to file a bug report in your issue tracker, but the bright yellow box at the top of the "report issue" page made it sound like I should send my report here instead.
>
> The problem is that cmake cannot identify the compiler, when compiling any project (that uses cmake) universally (i.e. for more than one architecture, e.g. for both x86_64 and i386):
>
> -- cmake version 3.3.2
> -- The C compiler identification is unknown
> -- The CXX compiler identification is unknown
>
> This could cause programs that rely on identifying the compiler to either build incorrectly or even (e.g. in the case of x265) to fail to build at all. For cross-referencing purposes, this problem was previously reported to the MacPorts project here:
>
> https://trac.macports.org/ticket/48331

Is it possible that beyond setting CMAKE_OSX_ARCHITECTURES the project 
also tries to manually add -arch flags to CFLAGS/CXXFLAGS?

The test binary produced for compiler identification with just 
CMAKE_OSX_ARCHITECTURES set is not a fat binary for me and 
identification is successful (CMake 3.3.2).

Manually adding "-arch x86_64 -arch i386" to the compiler flags breaks 
this since now the test binary itself is also fat.

Nils


More information about the cmake-developers mailing list