because Fpc is currently incompatible with the
Developer Command Line Tools on new version macOS, errors may occur when rebuilding Lazarus or building packages/apps.
after research and comparison, we found that the simplest solution is to install
XCode 15 and enable the
Developer Command Line Tools included in it for building. this way we don't have to modify fpc.cfg everywhere, nor do we have to set -WM10.15 everywhere, and we can build the native Aarch64 version.
the specific steps are as follows:
1. download
Xcode_15.xip from Apple's official website (not Developer Command Line Tools, but Xcode)
https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_15/Xcode_15.xip2. double-click it to unpack as
Xcode.app, change its name to
Xcode15.app, and copy it to
/Applications (it doesn’t matter if the app icon is abnormal)
3. enable the Developer Command Line Tools in Xcode 15
sudo xcode-select -s /Applications/Xcode15.app
sudo xcodebuild -license
4. build Fpc and Lazarus by
fpcupdeluxe https://github.com/LongDirtyAnimAlf/fpcupdeluxe.
for Fpc,
fixes-3.2 or
3.3.1 recommended.
for Lazarus,
trunk or
fixes-4.0 recommended.
no options are required.
5. it will give you a working FPC and Lazarus. Lazarus itself can be rebuilt, packages can be installed, and Lazarus can compile and debug apps normally.
good luck.