Hacker News new | ask | show | jobs
by eqvinox 1917 days ago
I don't know what exactly the poster was dealing with, but I've been trying to get reproducible builds out of cmake and it was a serious pain due to cmake insisting on using absolute file paths.

(Ed.: Also I agree the cmake docs are atrocious.)

1 comments

> due to cmake insisting on using absolute file paths

????

I can't tell you whether this is/was innate cmake behavior or whether something was wrong with the specific project, but cmake passed all source file names to the compiler using the full file system path rather than a relative path.

This is a serious (though slowly becoming a non-issue) problem since compilers encode source file names into the output binary's debug information and strings (__FILE__). The "-fdebug-prefix-map=old=new" GCC option and its cousins are what is slowly making this a non-issue, but those are a relatively recent addition.

It is generator-specific. Try "Unix Makefiles" vs "Ninja" and you'll see the difference.