Skip to content

Commit e98b241

Browse files
committed
cmake: enable -fPIC for all targets by default
1 parent 4264391 commit e98b241

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ option(STATIC_CHECK "Enable static check" OFF)
2525

2626
option(ENABLE_VISUALIZATION "Enable visualization targets" ON)
2727

28+
## Enable -fPIC for all targets
29+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
30+
2831
if (BUILD_AS_MODULE OR (NOT (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")))
2932
message(STATUS "Visualization targets are not build on non-x86_64 or when built as module")
3033
set(ENABLE_VISUALIZATION OFF)

0 commit comments

Comments
 (0)