diff --git a/CMakeLists.txt b/CMakeLists.txt index ebdce53228..e71f799b54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,8 +125,8 @@ check_pie_supported( OUTPUT_VARIABLE ZIG_PIE_SUPPORTED_BY_CMAKE LANGUAGES C CXX ) -if(ZIG_PIE AND NOT ZIG_PIE_SUPPORTED_BY_CMAKE) - message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target") +if(ZIG_PIE AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED) + message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target: ${ZIG_PIE_SUPPORTED_BY_CMAKE}") endif()