Correctly check if PIE is fully working.
This commit is contained in:
parent
627473e7da
commit
8a2f368795
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue