Skip to content

Commit

Permalink
fix(build): default to -fPIC when building shared libraries
Browse files Browse the repository at this point in the history
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
  • Loading branch information
gnosek authored and poiana committed Jul 20, 2023
1 parent 619131e commit 3aa48a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/modules/CompilerFlags.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
option(BUILD_WARNINGS_AS_ERRORS "Enable building with -Wextra -Werror flags")

option(ENABLE_PIC "Build position independent libraries and executables" OFF)
option(ENABLE_PIC "Build position independent libraries and executables" ${BUILD_SHARED_LIBS})
if(ENABLE_PIC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
Expand Down

0 comments on commit 3aa48a4

Please sign in to comment.