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 committed Jul 20, 2023
1 parent 1d66e10 commit aa09938
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/modules/CompilerFlags.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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})
message(STATUS "*** ENABLE_PIC=${ENABLE_PIC}")
if(ENABLE_PIC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
Expand Down

0 comments on commit aa09938

Please sign in to comment.