From 3f50447013f2e249633213de22534fa599597caf Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Fri, 29 Jan 2021 12:56:42 -0600 Subject: [PATCH] Fix dynamic libs build --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82a21c3d..0460207a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,9 @@ set( CMAKE_CXX_STANDARD 14 ) set( GRAPHENE_BUILD_DYNAMIC_LIBRARIES OFF CACHE BOOL "Whether to build dynamic libraries instead of static. Applies only to chain, db, protocol, net, and utilities" ) +if( GRAPHENE_BUILD_DYNAMIC_LIBRARIES ) + set( CMAKE_POSITION_INDEPENDENT_CODE ON ) +endif() # http://stackoverflow.com/a/18369825 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")