4 ms·
If you write standard compliant C, don't use platform specific headers, and use some kind of cross-platform build system (I can't recommend CMake enough here),
by biggestdecision 8y ago
If you write standard compliant C, don't use platform specific headers, and use some kind of cross-platform build system (I can't recommend CMake enough here), it's easy to use C/C++ across platforms. UI/graphics is harder, but cross-platform solutions do exist here (Qt, GTK, WxWidgets, OpenGL).
- sdinsn 8y ago> don't use platform specific headers Which is often unavoidable if you want to do filesystem stuff.
- xedrac 8y ago> I can't recommend CMake enough here I've used CMake for many years. But now that I've discovered Meson, I cry a little every time I have to edit a CMakeLists.txt file.
- lbbe 8y agoBut meson used pkg-config under the hood, which looks very unusual/like alien creation for Windows Devs.
- int_19h 8y agoThese days with stuff like MSYS2 readily available, it's not really as alien as one might think.
- flukus 8y agoIf your using stuff like MSYS2 does cmake/meson have a big advantage over old make/autoconf? I thought cross platform was the biggest selling point for these tools.
- aepiepaey 8y agoOne selling point seems to be speed: https://mesonbuild.com/Performance-comparison.html https://mesonbuild.com/Performance-comparison.html
- int_19h 8y agoFor me, sanity is the main selling point. Make has meaningful space/tab distinction - that's quite enough to disqualify it as hopelessly mad in my book. And then autoconf is just baroque. CMake only helps a little bit (it's still very old and has way too many warts). But Meson is very pleasant to work with.
- biggestdecision 8y agoThe biggest issue with CMake is how many libraries seem to have really low quality CMakeLists.txt's. CMake is very easy to use, if you do things properly with targets. include_directories and link_libraries should never never ever be used, use target_include_directories and target_link_libraries instead. This way there is no need to mess about with shell script style variables for dependencies. But so many resources online explain to people how to do things the wrong way, and so their libs end up being a pain to build or depend on.
- flukus 8y agoIME the documentation is great at a command level but does a poor job of explaining how things fit together at a macro level. I did a large project conversion last year and was well into it before I started getting a feel for how everything fit together with Public/Private.