diff --git a/cmake/modules/CompilerFlags.cmake b/cmake/modules/CompilerFlags.cmake index dc9480c6e2..7c6824bad7 100644 --- a/cmake/modules/CompilerFlags.cmake +++ b/cmake/modules/CompilerFlags.cmake @@ -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()