Use -fPIC option when building shared libs

This commit is contained in:
Michał Janiszewski 2017-11-12 23:25:53 +01:00 committed by Chris Marsh
parent d121bbe709
commit b206dd44f0

View file

@ -76,6 +76,10 @@ if(UNIX)
) )
target_compile_options(discord-rpc PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-std=c++14>) target_compile_options(discord-rpc PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)
if (${BUILD_SHARED_LIBS})
target_compile_options(discord-rpc PRIVATE -fPIC)
endif (${BUILD_SHARED_LIBS})
if (APPLE) if (APPLE)
target_link_libraries(discord-rpc PRIVATE "-framework AppKit") target_link_libraries(discord-rpc PRIVATE "-framework AppKit")
endif (APPLE) endif (APPLE)