Undeclared identifier 'H_SAVE_FP'

Trying to build SWI-PROLOG using cmake as described here

on my Mac Mini (arm64), but running the ‘ninja‘ command, it seems to get stuck on the use of the ‘undeclared identifier H_SAVE_FP‘ relative to the file
../swipl-devel/packages/libedit/libedit4pl.c:2111:24
I’m sorry if this issue has already been treated before, I wasn’t able to find anything regarding it. I just need the graphical tracer and xpce library that do not come with the stable home-brew installation.

Thanks for reporting. Pushed a work-around.

I was about to comment on the same issue. On MacOS, using Homebrew for installing packages, there is a message on some packages, including libedit:

==> Caveats
libedit is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

For compilers to find libedit you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libedit/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libedit/include"

For pkgconf to find libedit you may need to set:
  export PKG_CONFIG_PATH="/opt/homebrew/opt/libedit/lib/pkgconfig"

Until now, I have been apparently building against the MacOS provided libedit. It does not even have H_SAVE_FP.

How can one permanently enable finding homebrew packages? At least on my system, this worked:

a file homebrew.cmake:

set(HOMEBREW_PREFIX "/opt/homebrew"
    CACHE PATH "Path to Homebrew installation")

set(CMAKE_C_COMPILER "/usr/bin/gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/g++")

set(CMAKE_PREFIX_PATH
    "${HOMEBREW_PREFIX}"
    # These libraries are keg-only and not loaded into
    # the root prefix by default (to avoid clashes).
    "${HOMEBREW_PREFIX}/opt/libedit"
    "${HOMEBREW_PREFIX}/opt/zlib"
)

list(TRANSFORM CMAKE_PREFIX_PATH APPEND "/include"
     OUTPUT_VARIABLE CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES)
set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES}")

set(CMAKE_FIND_FRAMEWORK NEVER)
set(CMAKE_FIND_APPBUNDLE NEVER)

set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH FALSE)
set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH FALSE)

assuming that I have installed both zlib and libedit with homebrew; then adding the following to the cmake invocation:

cmake -Wno-dev \
   -DCMAKE_TOOLCHAIN_FILE=cmake/homebrew.cmake \
   -DCMAKE_INSTALL_PREFIX="$HOME"
   # and so on