Nice to see CMake!
And also nice to see an effort to make something lighter than glib.
It may be worth looking at BSD's base system in /usr/src to see code you can use as a reference, or add in a generic way. Take a look at #ifdef in ISC/MIT/BSD applications to see if you can port it in to offer portable functions.
Hm, examples: https://github.com/tmux/tmux/blob/master/compat.h -> https://github.com/tmux/tmux/tree/master/compat
For inspiration, all SDL2 is a cross-platform wrapper which probably has chunks that may be useful: https://github.com/spurious/SDL-mirror/tree/master/src, SDL_net: https://hg.libsdl.org/SDL_net/file/c5b3c4171459
Maybe the above is relevant / helpful / an inspiration.
We need a lite, portable glib alternative. I'm guessing it must be hard to do. I wish there was a a library where we could just pick what we want and not have to buy into an object model, which inevitably entails a lot of dependencies downstream.
Good luck with this! Look forward to watching it grow. Starred.