From d60c80a4a3ad7959c84a7d4d8e35fa8f1ec2ea11 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 14 Jun 2026 12:44:49 +0100 Subject: [PATCH] Build with -fPIC. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d43732d56..3b82143b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,7 @@ include(CheckFunctionExists) include(CheckTypeSize) include(CheckLibraryExists) include(CheckCXXCompilerFlag) +include(CheckPIESupported) if(NOT WIN32) include(FindPkgConfig) @@ -40,6 +41,10 @@ if(EXTRA_LIBS) link_directories(${EXTRA_LIBS}) endif() +# Enable -fPIC for all targets. +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +check_pie_supported() + # Find gettext find_package(Gettext) find_package(Intl)