mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-16 11:55:16 +00:00
Force PIE usage on linux (#625)
* force PIE usage on linux * get rid of explicit -pie linker flag * change UNIX with UNIX AND NOT APPLE in CMakeLists.txt * cmake: add proper check for PIE support at link time --------- Co-authored-by: Mikhail Paulyshka <me@mixaill.net>
This commit is contained in:
parent
738c28621e
commit
256cafcc1f
|
@ -17,6 +17,18 @@ endif()
|
|||
|
||||
project(shadPS4)
|
||||
|
||||
# Forcing PIE makes sure that the base address is high enough so that it doesn't clash with the PS4 memory.
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
# check PIE support at link time
|
||||
include(CheckPIESupported)
|
||||
check_pie_supported(OUTPUT_VARIABLE pie_check LANGUAGES C CXX)
|
||||
if(NOT CMAKE_C_LINK_PIE_SUPPORTED OR NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
|
||||
message(WARNING "PIE is not supported at link time: ${pie_check}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
|
||||
|
||||
# This function should be passed a list of all files in a target. It will automatically generate file groups
|
||||
|
|
Loading…
Reference in a new issue