From 9c7210cb65ad8f5698537b7aea7e609040530878 Mon Sep 17 00:00:00 2001 From: Username404 Date: Fri, 12 Nov 2021 21:24:43 +0100 Subject: [PATCH] Improve the message shown when position-independent code is not supported --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bdfbae5..44e5de4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,11 +22,11 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) include(CheckPIESupported) -check_pie_supported(OUTPUT_VARIABLE pie_output LANGUAGES CXX) -if (NOT CMAKE_CXX_LINK_PIE_SUPPORTED) - message(WARNING "Link-time PIE not supported\n${pie_output}") -else() +check_pie_supported(LANGUAGES CXX) +if (CMAKE_CXX_LINK_PIE_SUPPORTED) set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) +else() + message(NOTICE "Position-Independent Code (PIC) is not supported by the current toolchain") endif() set(CMAKE_CXX_FLAGS "-Wall") set(CMAKE_CXX_FLAGS_RELEASE "-Os")