cryptopp-cmake
cryptopp-cmake copied to clipboard
Cannot cross-compile to IOS on Apple Silicon
Hi, When I used the latest version to compile the static library of ios, the following error occurred. Git Tag: 7ae29c98ae135dc0a0aa76c17396c96b1c562168
-- Crypto++ auto fetched at: /Users/yangjun/jerome/paddle/cryptopp-cmake/build_ios/_deps/cryptopp
-- Using branch master for tests
=> Module : cryptopp
-- [cryptopp] CMake version 3.23.1
-- [cryptopp] System iOS
-- [cryptopp] Processor
-- [cryptopp] CMAKE_OSX_ARCHITECTURES : armv7;arm64
-- [cryptopp] CMAKE_HOST_SYSTEM_PROCESSOR : arm64
-- [cryptopp] CMAKE_SYSTEM_PROCESSOR :
CMake Error at cmake/TargetArch.cmake:73 (message):
Invalid OS X arch name: armv7
Call Stack (most recent call first):
cryptopp/CMakeLists.txt:182 (target_architecture)
cryptopp/CMakeLists.txt:210 (check_target_architecture)
-- Configuring incomplete, errors occurred!
See also "/Users/yangjun/jerome/paddle/cryptopp-cmake/build_ios/CMakeFiles/CMakeOutput.log".
See also "/Users/yangjun/jerome/paddle/cryptopp-cmake/build_ios/CMakeFiles/CMakeError.log".
objc[12694]: Class AppleTypeCRetimerRestoreInfoHelper is implemented in both /usr/lib/libauthinstall.dylib (0x1e4f55eb0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10928c4f8). One of the two will be used. Which one is undefined.
objc[12694]: Class AppleTypeCRetimerFirmwareAggregateRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x1e4f55f00) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10928c548). One of the two will be used. Which one is undefined.
objc[12694]: Class AppleTypeCRetimerFirmwareRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x1e4f55f50) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10928c598). One of the two will be used. Which one is undefined.
objc[12694]: Class ATCRTRestoreInfoFTABFile is implemented in both /usr/lib/libauthinstall.dylib (0x1e4f55fa0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10928c5e8). One of the two will be used. Which one is undefined.
objc[12694]: Class AppleTypeCRetimerFirmwareCopier is implemented in both /usr/lib/libauthinstall.dylib (0x1e4f55ff0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10928c638). One of the two will be used. Which one is undefined.
objc[12694]: Class ATCRTRestoreInfoFTABSubfile is implemented in both /usr/lib/libauthinstall.dylib (0x1e4f56040) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10928c688). One of the two will be used. Which one is undefined.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project cryptopp-cmake.xcodeproj build -target ALL_BUILD -parallelizeTargets -configuration Release -hideShellScriptEnvironment
User defaults from command line:
HideShellScriptEnvironment = YES
IDEPackageSupportUseBuiltinSCM = YES
xcodebuild: error: 'cryptopp-cmake.xcodeproj' does not exist.
Compile command:
cmake .. -GXcode \
-DCMAKE_SYSTEM_NAME=iOS \
"-DCMAKE_OSX_ARCHITECTURES=armv7;arm64" \
-DCMAKE_OSX_SYSROOT=iphoneos\
-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0 \
-DCMAKE_INSTALL_PREFIX=`pwd`/_install \
-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
-DCMAKE_IOS_INSTALL_COMBINED=YES \
-DENABLE_BITCODE=NO \
-DCMAKE_BUILD_TYPE=Release \
-DCRYPTOPP_BUILD_TESTING=OFF \
cmake --build . --config Release
Could you provide also the lines from the beginning of the config process and a config log of the working run so we can possible spot the differences? From what you've provided I can tell only some generic points like:
- docs say if you provide CMAKE_SYSTEM_NAME you also need to provide CMAKE_SYSTEM_VERSION, so it shouldn't have worked in the past, also.
- the code handling this wasn't changed and armv7 isn't checked there, so it shouldn't have worked in the past also.