mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
cmake: Add position independent code support
This commit is contained in:
parent
07069e2bb0
commit
fd72d00ffe
1 changed files with 11 additions and 0 deletions
|
@ -63,6 +63,17 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
|
||||||
|
|
||||||
set(configure_warnings)
|
set(configure_warnings)
|
||||||
|
|
||||||
|
include(CheckPIESupported)
|
||||||
|
check_pie_supported(OUTPUT_VARIABLE check_pie_output LANGUAGES CXX)
|
||||||
|
if(CMAKE_CXX_LINK_PIE_SUPPORTED)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
elseif(NOT WIN32)
|
||||||
|
# The warning is superfluous for Windows.
|
||||||
|
message(WARNING "PIE is not supported at link time: ${check_pie_output}")
|
||||||
|
list(APPEND configure_warnings "Position independent code disabled.")
|
||||||
|
endif()
|
||||||
|
unset(check_pie_output)
|
||||||
|
|
||||||
# The core_interface library aims to encapsulate common build flags.
|
# The core_interface library aims to encapsulate common build flags.
|
||||||
# It is a usage requirement for all targets except for secp256k1, which
|
# It is a usage requirement for all targets except for secp256k1, which
|
||||||
# gets its flags by other means.
|
# gets its flags by other means.
|
||||||
|
|
Loading…
Add table
Reference in a new issue