Improve the message shown when position-independent code is not supported
This commit is contained in:
parent
a4575a726d
commit
9c7210cb65
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue