TurningWheel / Barony

Barony Open Source Release
http://www.baronygame.com/
Other
501 stars 130 forks source link

[macOS] libpng and SDL header paths #78

Open HiPhish opened 7 years ago

HiPhish commented 7 years ago

I was trying to compile the source on macOS and I ran into two issues:

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?

addictgamer commented 7 years ago

add the output of sdl2-config --cflags to the makefile?

You mean add it to CMakeLists.txt?

HiPhish commented 7 years ago

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.

addictgamer commented 7 years ago

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.