You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMake: properly fix build on macOS with Ninja (related to response files)
On macOS several build-related programs (`cc`, `ar`) will not accept
the linker line if too many files have been added to it in the
DYNAMIC_ARCH case. (This now occurs on all platforms where macOS
runs / used to run, as there are enough ARM variants that are
build with DYNAMIC_ARCH that the number of files exceeds the
intrinsic limit on macOS.)
The workaround for this is to use response files that contain the
file list themselves, and pass these to the build system. For
dynamic libraries this works fine, but for static libraries it
doesn't because `ar` doesn't accept response files on macOS. For this
reason there was previously a workaround in CMakeLists.txt to handle
this, but the workaround didn't take into consideration that when
building only a shared library it is not actually necessary, and
when building static libraries the response file CMake generates for
Ninja is at a different location than the response files CMake
generates for Unix Makefiles.
This commit cleans this all up by setting the necessary options for
the response files to be properly generated, and adjusts the additional
workaround to only be applicable in the case a static library is
built. The workaround is also adjusted to handle the Ninja case.
Fixes GitHub issue #5775
0 commit comments