Skip to content

Commit 7a15ea0

Browse files
committed
Runttimes: always build the runtime as PIC
When building the runtime, we do not know how it will be loaded even if it is static. Default to building in PIC mode for non-Windows targets (Windows is always implicit PIC).
1 parent f0b27bc commit 7a15ea0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ set(CMAKE_C_VISIBILITY_PRESET "hidden")
3535
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
3636
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
3737

38+
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
39+
3840
set(SwiftCore_CMAKE_MODULES_DIR "${CMAKE_SOURCE_DIR}/cmake/modules")
3941
list(APPEND CMAKE_MODULE_PATH ${SwiftCore_CMAKE_MODULES_DIR})
4042

0 commit comments

Comments
 (0)