Open HiPhish opened 7 years ago
add the output of sdl2-config --cflags to the makefile?
You mean add it to CMakeLists.txt?
You mean add it to CMakeLists.txt?
Probably, I am not familiar with with CMake. What I meant was that instead of hard-coding the path to the SDL libraries the build system should use the path returned by sdl2-config --cflags
.
A similar thing can be done for LibPNG using pkg-config --cflags libpng
, but one cannot rely on pkg-config being aware of LibPNG. How about a gradual approach? First try pkg-config --cflags libpng
, and if the exit status is not zero use a hard-coded path and hope for the best.
If somebody would like to take a look at this and other Mac build issues, feel free to open up a PR for perusal. I must admit there's leftover cruft and some bad practice in there just from my experimentation in making everything work properly on Mac. The biggest issue is I've only been able to test it on my computer.
I was trying to compile the source on macOS and I ran into two issues:
cmake
CMake was trying to findlibpng16.16.dylib
under/op/local/
, but mine was under/usr/local
<SDL2_image/SDL_image.h>
, but mine were under<SDL2/SDL_image.h>
.Fixing every instance of these two made everything compile without issues. I am using the Homebrew package manager, so maybe that is the issue here. I do know that MacPorts installs its packages under
/opt
, maybe that is what you were developing with. Is it possible to make the build system work with both?As for the SDL library headers, wouldn't it be better to use the same include form as for the other systems and add the output of
sdl2-config --cflags
to the makefile?