diff --git a/CMakeLists.txt b/CMakeLists.txt index 8755dc0fc12cf5..22e5d2a674e6d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,8 @@ include(CheckPIESupported) check_pie_supported(OUTPUT_VARIABLE check_pie_output LANGUAGES CXX) if(CMAKE_CXX_LINK_PIE_SUPPORTED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -else() +elseif(NOT WIN32) + # The warning is superfluous for Windows. message(WARNING "PIE is not supported at link time: ${check_pie_output}") list(APPEND configure_warnings "Position independent code disabled.") endif()