zig icon indicating copy to clipboard operation
zig copied to clipboard

cmake: correct PIE support detection, add error output for debugging

Open Jan200101 opened this issue 1 year ago • 2 comments

check_pie_supported only uses the OUTPUT_VARIABLE to to signify errors if PIE is actually supported is signaled by CMAKE_<lang>_LINK_PIE_SUPPORTED.

Checking if OUTPUT_VARIABLE is empty is not enough either since the check is bypassed if its results are cached but the output variable is not cached.

Jan200101 avatar May 26 '24 13:05 Jan200101

check_pie_supported only uses the OUTPUT_VARIABLE to to signify errors if PIE is actually supported is signaled by CMAKE_<lang>_LINK_PIE_SUPPORTED.

Checking if OUTPUT_VARIABLE is empty is not enough either since the check is bypassed if its results are cached but the output variable is not cached.

Sorry for this! I thought this will be enough according to my tests and documentation for 3.15, but I disn't read a note from 3.23+ dkcumentation. Again, sorry...

BratishkaErik avatar May 26 '24 14:05 BratishkaErik

No worries, this happens to all of us.

Jan200101 avatar May 26 '24 15:05 Jan200101