File: Set-CMAKE_POSITION_INDEPENDENT_CODE-to-ON.patch

package info (click to toggle)
libbgcode 0.0~git20250220.5041c09-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,188 kB
  • sloc: cpp: 3,700; python: 255; makefile: 6
file content (23 lines) | stat: -rw-r--r-- 634 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Chow Loong Jin <hyperair@debian.org>
Date: Sat, 28 Dec 2024 12:46:21 +0800
Subject: Set CMAKE_POSITION_INDEPENDENT_CODE to ON

Required to prevent relocation errors while linking
---
 CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 874e56b..ca4ae0f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,9 @@ include(cmake/ProjectVersion.cmake)
 
 project(LibBGCode VERSION ${LibBGCode_VERSION})
 
+# Turn on position independent code
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
 # Set C++ standard
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)