Skip to content
Snippets Groups Projects
Commit cfa85062 authored by Martin Nolte's avatar Martin Nolte
Browse files

[cmake] enable position independent code by default

This patch add an option `CMAKE_POSITION_INDEPENDENT_CODE` defaulting to
`ON`, but only if `BUILD_SHARED_LIBS` is `OFF`. Otherwise we always
build position independent code, anyway.
parent 2e4e53ee
No related branches found
No related tags found
1 merge request!360[cmake] enable position independent code by default
Pipeline #
......@@ -668,9 +668,8 @@ macro(dune_project)
# This should allow DUNE modules to use CMake's object libraries.
# This can be overwritten for targets by setting the target property
# POSITION_INDEPENDENT_CODE to false/OFF
if(BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
include(CMakeDependentOption)
cmake_dependent_option(CMAKE_POSITION_INDEPENDENT_CODE "Build position independent code" ON "NOT BUILD_SHARED_LIBS" ON)
if(DUNE_USE_ONLY_STATIC_LIBS)
# Use only static libraries.
......
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