cmake: (maybe) build xcb-stuff STATIC library with -fPIC

When building plugins as shared libraries, xcb-stuff needs to be built
with -fPIC, since a couple of the plugins link against it.
This commit is contained in:
Daniel Eklöf 2019-02-07 12:24:20 +01:00
parent d185f7237d
commit e4f3695f5e

View file

@ -47,6 +47,13 @@ if (ENABLE_X11)
target_link_libraries(xcb-stuff PkgConfig::xcb-errors) target_link_libraries(xcb-stuff PkgConfig::xcb-errors)
endif () endif ()
# Since there are plugins linking against xcb-stuff, we need to
# ensure it's compiled with -fPIC when the plugins are compiled as
# shared libraries.
if (CORE_PLUGINS_AS_SHARED_LIBRARIES)
set_property(TARGET xcb-stuff PROPERTY POSITION_INDEPENDENT_CODE 1)
endif ()
endif () endif ()
if (ENABLE_WAYLAND) if (ENABLE_WAYLAND)