CMake: Make sure that position independent code is enabled properly

This commit is contained in:
chaoticgd
2026-03-06 12:42:26 +00:00
committed by Ty
parent 3c7eb2ac88
commit ec6901b93d
2 changed files with 9 additions and 1 deletions
@@ -145,7 +145,7 @@ echo "Building libbacktrace..."
rm -fr "libbacktrace-$LIBBACKTRACE"
unzip "$LIBBACKTRACE.zip"
cd "libbacktrace-$LIBBACKTRACE"
./configure --prefix="$INSTALLDIR"
./configure --prefix="$INSTALLDIR" --with-pic
make
make install
cd ..
+8
View File
@@ -270,6 +270,14 @@ endif()
set(PCSX2_WARNINGS ${DEFAULT_WARNINGS})
# Make sure we're building with position independent code enabled. Without this
# check, on some platforms (e.g. Fedora 43) the right flags won't be passed to
# the linker, resulting in a broken build when LTO is enabled.
include(CheckPIESupported)
check_pie_supported()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
#-------------------------------------------------------------------------------
# MacOS-specific things
#-------------------------------------------------------------------------------