diff options
Diffstat (limited to 'common/rfb/CMakeLists.txt')
-rw-r--r-- | common/rfb/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt index be03c646..f8c1a432 100644 --- a/common/rfb/CMakeLists.txt +++ b/common/rfb/CMakeLists.txt @@ -95,6 +95,14 @@ add_library(rfb STATIC ${RFB_SOURCES}) target_link_libraries(rfb ${RFB_LIBRARIES}) +# This code goes into libvnc.so, so it needs to be PIC on x86_64. +# (It should be on archs as well, but we prefer performance over memory +# efficiency. Win64 is excluded because PIC is always on there and it +# complains when you give it the explicit flag.) +if(CMAKE_COMPILER_IS_GNUCXX AND (CMAKE_SIZEOF_VOID_P MATCHES 8) AND NOT WIN32) + set_target_properties(rfb PROPERTIES COMPILE_FLAGS -fPIC) +endif() + if(UNIX) libtool_create_control_file(rfb) endif() |