Open diuming opened 1 year ago
Boost::context library boost/libs/context/CMakeLists.txt selects asm sources based on CMAKE_SYSTEM_PROCESSOR
variable during CMake configuration step.
CMAKE_SYSTEM_PROCESSOR
specifies single architecture, which in your case happens to be arm64.
So the build fails when trying to build x86_64 part of universal lib.
As a workaround, it should be possible to build arm64 and x86_64 libraries separately, then combine them into universal lib using lipo.
Build arm64 only:
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_SYSTEM_PROCESSOR=arm64
Build x86_64 only:
-DCMAKE_OSX_ARCHITECTURES=x86_64
-DCMAKE_SYSTEM_PROCESSOR=x86_64
The real solution will probably require changes in CMake itself, like support for $<CMAKE_SYSTEM_PROCESSOR>
generator expression.
Try to build as
universal
lib on macOS Apple M1, but always failed. Is it possible to build boost asuniversal
lib on macOS Apple M1?cmake command with options
Error messages