From b206dd44f03dd416175abd4c65680bb85e7ac0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 12 Nov 2017 23:25:53 +0100 Subject: [PATCH] Use -fPIC option when building shared libs --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3b96961..3839781 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -76,6 +76,10 @@ if(UNIX) ) target_compile_options(discord-rpc PRIVATE $<$:-std=c++14>) + if (${BUILD_SHARED_LIBS}) + target_compile_options(discord-rpc PRIVATE -fPIC) + endif (${BUILD_SHARED_LIBS}) + if (APPLE) target_link_libraries(discord-rpc PRIVATE "-framework AppKit") endif (APPLE)