diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-08-22 11:38:35 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-08-22 11:38:35 +0000 |
commit | 92b4f9de986c5a9b72af8af61b8d3afcab1581d5 (patch) | |
tree | 0652876728abfca1e458574ebe926a7edd136f19 /common/os | |
parent | 04c4bad82febd8e5ec1fed5fb62fd46b78c2886b (diff) | |
download | tigervnc-92b4f9de986c5a9b72af8af61b8d3afcab1581d5.tar.gz tigervnc-92b4f9de986c5a9b72af8af61b8d3afcab1581d5.zip |
CMake doesn't handle convenience libraries as nicely as autotools does. We
need to be explicit with -fPIC here as we use these in libvnc.so.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4645 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/os')
-rw-r--r-- | common/os/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/os/CMakeLists.txt b/common/os/CMakeLists.txt index 82f11659..623a32f8 100644 --- a/common/os/CMakeLists.txt +++ b/common/os/CMakeLists.txt @@ -5,3 +5,11 @@ add_library(os STATIC net.c os.cxx tls.cxx) + +# 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(os PROPERTIES COMPILE_FLAGS -fPIC) +endif() |