Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I mostly use CMake and even in perfect CMake projects it's still a pain to do (since you need all these build folders) - and most projects aren't "perfect" CMake projects, e.g. I'm using portaudio, SDL and their CMake scripts are fairly opinionated and need manual hacking to get required build configurations


I don’t mind modifying the CMake files for my dependencies, or when I’m using Bazel, writing the Bazel build files from scratch. I understand that not everyone feels this way, and it depends on how much labor you can spare for wrangling builds, but I still feel that this is less extreme / preferable to going header-only when header-only is not required for some other reason.

Yes, updating my Bazel build files for third-party dependencies creates extra toil when I upgrade versions. In my experience, this is a small amount of toil compared to the API changes a third-party will introduce (e.g. upgrading libfmt to 5.0 meant touching a hundred files), so I am willing to pay that price to get faster builds.

Or I’d put it this way:

- Most of my time is spent making changes, recompiling, and seeing the results. Small improvements here have a large positive impact on productivity, and header-only libraries make this worse.

- A small amount of my time is spent managing the build system and writing build scripts. Tasks like writing my own Bazel build script for a third-party dependency are not done often, maybe only when porting to a new platform or updating to a new version, so even though I spend extra time here, it is not burdensome.


But once you get CMake to build a VS project with, say, SDL and Lua already linked then it's still much easier than doing it through VS itself every time. The problem is getting it to do that, though.

I don't know why it can't be simpler but apparently it can't.


sure, but it's even more simple to just add a single path to the headers.

How many CMake config files export targets for debug and release windows libs for instance ?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: