cmake: correct PIE support detection, add error output for debugging
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.
check_pie_supportedonly uses theOUTPUT_VARIABLEto to signify errors if PIE is actually supported is signaled byCMAKE_<lang>_LINK_PIE_SUPPORTED.Checking if
OUTPUT_VARIABLEis 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...
No worries, this happens to all of us.