Skip to content
Snippets Groups Projects
Commit 1680070b authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Force compiler to create position independent code

This adds -fPIC to gcc/clang.
parent dc93558d
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,12 @@ if(NOT COMPILER_IS_MSVC)
set( CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem" CACHE STRING "" FORCE )
endif()
# When static libraries are used in some shared libraries it is required that
# also the static libraries have position independent code.
if(BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
endif()
# Set additional user-given compiler flags
set(CMAKE_CXX_FLAGS ${OGS_CXX_FLAGS})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment