aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'common/rdr/CMakeLists.txt')
-rw-r--r--common/rdr/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/rdr/CMakeLists.txt b/common/rdr/CMakeLists.txt
index ee71a9bb..6d3ec1d6 100644
--- a/common/rdr/CMakeLists.txt
+++ b/common/rdr/CMakeLists.txt
@@ -24,6 +24,14 @@ endif()
target_link_libraries(rdr ${RDR_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(rdr PROPERTIES COMPILE_FLAGS -fPIC)
+endif()
+
if(UNIX)
libtool_create_control_file(rdr)
endif()