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")