sudo cmake -DCMAKE_BUILD_TYPE=Release -S . -B cmake-build-release -Wno-dev -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX
sudo cmake --build ./cmake-build-release --config Release
最终导致lipo
被调用,在那里它抱怨:
warning: Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: Invalid value (Producer: 'LLVM15.0.6' Reader: 'LLVM APPLE_1_1300.0.29.3_0')
fatal error: Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't figure out the architecture type of: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/PluginProcessor-eb9c16/PluginProcessor-arm64.o
我相信lipo
被调用,因为我把它添加到我的cmake项目:
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
谁知道是否有可能告诉cmake使用llvm-lipo
而不是lipo
?
根据文档CMAKE_OSX_ARCHITECTURES
必须在project()
调用之前设置