Correctly check if PIE is fully working.

This commit is contained in:
Username404-59 2021-03-29 00:20:41 +02:00
parent 627473e7da
commit 8a2f368795
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 5 additions and 5 deletions

View File

@ -17,13 +17,13 @@ configure_file("resources/${PROJECT_NAME}.rc" "processed/${PROJECT_NAME}.rc" @ON
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(CheckPIESupported)
check_pie_supported(OUTPUT_VARIABLE output LANGUAGES CXX)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_CXX_FLAGS "-Wall")
if (CMAKE_POSITION_INDEPENDENT_CODE)
include(CheckPIESupported)
check_pie_supported()
if (NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
message(WARNING "Link-time PIE not supported")
endif()
set(CMAKE_CXX_FLAGS "-Wall")
if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")