Skip to content

Commit f3df916

Browse files
committed
Enable PIC code even for static libs
1 parent e51bc0e commit f3df916

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ option(DEBUGINFOD "Compile with debuginfod support" ON)
1313

1414
math(EXPR PLATFORM_BITS "${CMAKE_SIZEOF_VOID_P} * 8")
1515
set(PSTACK_BIN "pstack" CACHE STRING "Name of the 'pstack' binary")
16+
17+
# Generate position independent code, even for static libs - that way we can
18+
# link them to shared libs.
19+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
20+
1621
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/" CACHE STRING "Rpath to install for binaries or the empty string")
1722
set(LIBTYPE "SHARED" CACHE STRING "Build libraries as STATIC or SHARED")
1823
set (PYTHON3_SOURCE "" CACHE STRING "Path to the CPython source code")

0 commit comments

Comments
 (0)