[cmake-developers] [CMake 0015835]: CMake hardcodes bitness in .cmake files for universal binaries
Mantis Bug Tracker
mantis at public.kitware.com
Thu Nov 5 16:44:51 EST 2015
The following issue has been SUBMITTED.
======================================================================
https://cmake.org/Bug/view.php?id=15835
======================================================================
Reported By: David Ryskalczyk
Assigned To:
======================================================================
Project: CMake
Issue ID: 15835
Category: CMake
Reproducibility: always
Severity: major
Priority: high
Status: new
======================================================================
Date Submitted: 2015-11-05 16:44 EST
Last Modified: 2015-11-05 16:44 EST
======================================================================
Summary: CMake hardcodes bitness in .cmake files for
universal binaries
Description:
CMake currently hardcodes the bitness of a built package in the .cmake config
file. As Mac OS X supports universal binaries, where a package can be compiled
as both 32 and 64 bit, this is inaccurate, and causes problems when linking to
libraries built as universal using CMAKE_OSX_ARCHITECTURES.
This affects all versions of Mac OS X.
Steps to Reproduce:
Build a library as a universal binary (using
-DCMAKE_OSX_ARCHITECTURES=x86_64;i386); then try compiling a program that uses
that library as either x86_64 or i386. One of them will work, the other will
not. If the Config .cmake file is opened in an editor, it is obvious that the
bitness is recorded and checked, based on the value of CMAKE_SIZEOF_VOID_P —
which is inaccurate when the binary is built as universal.
Additional Information:
A better fix might be to store a list of architectures/bitness that the package
is built as, but I'm unsure of how to do this in CMake.
A patch is attached which simply ignores the bitness section of the config
.cmake files when building on OS X.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2015-11-05 16:44 David RyskalczykNew Issue
2015-11-05 16:44 David RyskalczykFile Added: cmake-osx-universal-patch.diff
======================================================================
More information about the cmake-developers
mailing list