summarylogtreecommitdiffstats
path: root/0001-fix-building-with-ctk.patch
blob: bf1651b12546fb8541628f632afae78d0e454f1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From e966ebbebe4f8db15eef4ee3328667f8b7217204 Mon Sep 17 00:00:00 2001
From: Hu Butui <hot123tea123@gmail.com>
Date: Fri, 3 Apr 2026 23:15:08 +0800
Subject: [PATCH] fix building with ctk

Apply the CTK export-macro fix inside the CTK ExternalProject so that the
importing side uses Q_DECL_IMPORT on non-Windows platforms. Arch Qt6 defines
QT_USE_PROTECTED_VISIBILITY, so Q_DECL_EXPORT expands to
__attribute__((visibility("protected"))) and shared libraries referencing
protected symbols defined in another shared library fail to link ("undefined
protected symbol", R_X86_64_PC32 relocations). The PythonQt fork patch is not
applied anymore: the CTK revision pinned by Slicer already builds its own
patched PythonQt.

Signed-off-by: Hu Butui <hot123tea123@gmail.com>
---
 SuperBuild/External_CTK.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/SuperBuild/External_CTK.cmake b/SuperBuild/External_CTK.cmake
index bcec67cdeb..7b2a22c180 100644
--- a/SuperBuild/External_CTK.cmake
+++ b/SuperBuild/External_CTK.cmake
@@ -89,6 +89,7 @@ if(NOT DEFINED CTK_DIR AND NOT Slicer_USE_SYSTEM_${proj})
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${Slicer_${proj}_GIT_REPOSITORY}"
     GIT_TAG "${Slicer_${proj}_GIT_TAG}"
+    PATCH_COMMAND git apply --verbose ${CMAKE_SOURCE_DIR}/../0001-BUG-Fix-export-macro-for-non-Windows-platforms.patch
     SOURCE_DIR ${EP_SOURCE_DIR}
     BINARY_DIR ${EP_BINARY_DIR}
     CMAKE_CACHE_ARGS
-- 
2.54.0