mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 20:14:45 +00:00
Merge pull request #1 from Mixaill/pie
cmake: add proper check for PIE support at link time
This commit is contained in:
commit
4541a74605
1 changed files with 12 additions and 5 deletions
|
@ -6,11 +6,6 @@ cmake_minimum_required(VERSION 3.16.3)
|
|||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
enable_language(OBJC)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 11)
|
||||
|
@ -22,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…
Add table
Reference in a new issue