Build failed on macOS 15.4, due to "fp.h" not found

Platform info :

  • Apple Silicon M4
  • macOS SDK 15.4
  • Skia-m102
  • cmake version 4.0.1
  • ninja version 1.12.1

Build Command:

cmake \
  -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_OSX_ARCHITECTURES=arm64 \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=15.4 \
  -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
  -DLAF_BACKEND=skia \
  -DSKIA_DIR=$HOME/deps/skia \
  -DSKIA_LIBRARY_DIR=$HOME/deps/skia/out/Release-arm64 \
  -DSKIA_LIBRARY=$HOME/deps/skia/out/Release-arm64/libskia.a \
  -DPNG_ARM_NEON:STRING=on \
  -G Ninja \
  ..

Error info:

FAILED: third_party/libpng/scripts/intprefix.out /Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/intprefix.out
cd /Users/kcn/Downloads/aseprite/build/third_party/libpng && /opt/homebrew/bin/cmake -DINPUT=/Users/kcn/Downloads/aseprite/third_party/libpng/scripts/intprefix.c -DOUTPUT=/Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/intprefix.out -P /Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/genout.cmake
In file included from /Users/kcn/Downloads/aseprite/third_party/libpng/scripts/intprefix.c:21:
/Users/kcn/Downloads/aseprite/third_party/libpng/scripts/../pngpriv.h:524:16: fatal error: ‘fp.h’ file not found
524 | # include <fp.h>
| ^~~~~~
1 error generated.
CMake Error at scripts/genout.cmake:78 (message):
Failed to generate
/Users/kcn/Downloads/aseprite/build/third_party/libpng/scripts/intprefix.out.tf1

1 Like

I’ve recently started migrating my development workflow to macOS and am still familiarizing myself with its build toolchain. While troubleshooting a compilation error related to the missing fp.h header, I discovered through external resources that this issue might stem from macOS SDK versions deprecating or excluding fp.h in newer releases.

Given that this file appears to be part of the legacy CarbonCore framework, could you advise on:

  1. Workarounds to resolve the fp.h dependency (e.g., explicit framework linking, header path adjustments).
  2. Project-specific optimizations to modernize the build process and avoid reliance on deprecated components?

Any insights or documentation pointers would be greatly appreciated!

Hello, did you manage to find any fix ? I am at my wits end, tried 3 different tutorials but i always get stuck here at missing fp.h at line 524 :frowning: any help appreciated. Macbook air m3

I MANAGED TO FIX IT!! I simply changed the line 524 from <fp.h> to <math.h> and it ninja command compiled and produced exectuables in bin.

Thanks for sharing this fix! I’ll try this later.

1 Like

Fixed using these steps:

1 Like