cd /tmp/
echo 'library test_compilation; begin end.' > test_compilation.lpr
SIMULATOR_SDK='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk'
fpc -Px86_64 -Tiphonesim -WP7.0 -XR${SIMULATOR_SDK} test_compilation.lpr
# TODO: This iphonesim will fails with FPC 3.2.2 now on Silicon-based Mac.
# You can ignore it if you don't need simulator.
DEVICE_SDK='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk'
fpc -Parm -TiOS -WP7.0 -Cfvfpv3 -Cparmv7 -XR${DEVICE_SDK} test_compilation.lpr
fpc -Paarch64 -TiOS -WP7.0 -XR${DEVICE_SDK} test_compilation.lpr