SDLPoP includes SDL.h as #include <SDL.h> (not #include <SDL2/SDL.h>). The current Makefile works on Linux because pkg-config correctly passes cflags as #{prefix}/include/SDL2. Unfortunately, on macOS, /opt/local/include won't work - it would be /opt/local/include/SDL2.
Instead of fixing this with a hard-coded path, just rely on pkg-config to set the appropriate paths on both macOS and Linux. An additional benefit here is that people who have SDL2/SDL2_image installed in non-standard locations can adjust PKG_CONFIG_PATH to point at the appropriate search locations.
The same issue exists for the CMake-based build, which this PR also fixes.
SDLPoP includes
SDL.h
as#include <SDL.h>
(not#include <SDL2/SDL.h>
). The currentMakefile
works on Linux becausepkg-config
correctly passes cflags as#{prefix}/include/SDL2
. Unfortunately, on macOS,/opt/local/include
won't work - it would be/opt/local/include/SDL2
.Instead of fixing this with a hard-coded path, just rely on
pkg-config
to set the appropriate paths on both macOS and Linux. An additional benefit here is that people who have SDL2/SDL2_image installed in non-standard locations can adjustPKG_CONFIG_PATH
to point at the appropriate search locations.The same issue exists for the CMake-based build, which this PR also fixes.
We encountered this issue while packaging SDLPoP 1.22 for Homebrew - see downstream discussion at https://github.com/Homebrew/homebrew-core/pull/80795. Thanks!