Login
You're viewing the functional.cafe public feed.
  • Aug 16, 2026, 10:04 PM

    does anyone understand why #CMake doesn't just go like

    "oh you're running a totally normal Clang on a well known platform, I'm just gonna assume <string.h> and <stdlib.h> exists"

    Why do build systems insist on wasting sooo much time just doing these basic checks? There *has* to be a better way

    #programming #cplusplus #c #buildsystems

    💬 1🔄 0⭐ 1

Replies

  • 💬 0🔄 0⭐ 0
  • Aug 16, 2026, 10:24 PM

    @mort if you don't know, your "vendor" (os, clang package, etc) could install a simple cmake file defining the relevant definitions without doing the check; it's just that the one cmake provides has to be universal and therefore very cautious about assumptions.

    💬 1🔄 0⭐ 0
  • Aug 16, 2026, 10:41 PM

    @lens_r Well, neither the Homebrew CMake package for macOS nor Fedora's CMake package nor Ubuntu's CMake package seems to do that; all of those platforms check useless stuff like whether memcpy exists. CMake's mechanism for skipping these checks by default clearly isn't working.

    Also why does it have to check them *one by one*? Generate a source file with everything you expect to find in <string.h>, check them all with one compiler invocation. If it fails, *then* do detailed checks

    💬 0🔄 0⭐ 0
  • Aug 16, 2026, 11:10 PM

    @mort just another two files that will drift out of sync...

    You are right, many vendors do not take advantage of the extensive vendor customization possible in cmake. It's a shame, but it's also just a fact of life; they don't have time to worry about QoL for a couple devs when they have longstanding bugs and constant security updates to make...

    Could always be the change you want to see in the world

    💬 0🔄 0⭐ 0