add_subdirectory(network)
add_subdirectory(Xregion)
add_subdirectory(rfb)
+
+# For any convenience libraries that are linked into libvnc.so, we need to
+# explicitly build their corresponding sources using PIC. WIN32 is excluded
+# because PIC code does not exist on that platform and MinGW complains if -fPIC
+# is passed (additionally, libvnc is not used on Windows.)
+
+if(CMAKE_COMPILER_IS_GNUCXX AND (CMAKE_SIZEOF_VOID_P MATCHES 8) AND NOT WIN32)
+ set_target_properties(os rdr network Xregion rfb
+ PROPERTIES COMPILE_FLAGS -fPIC)
+ if(USE_INCLUDED_ZLIB)
+ set_target_properties(zlib PROPERTIES COMPILE_FLAGS -fPIC)
+ endif()
+endif()
add_library(Xregion STATIC
Region.c)
-# 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(Xregion PROPERTIES COMPILE_FLAGS -fPIC)
-endif()
-
if(UNIX)
libtool_create_control_file(Xregion)
endif()
add_library(network STATIC
TcpSocket.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(network PROPERTIES COMPILE_FLAGS -fPIC)
-endif()
-
if(UNIX)
libtool_create_control_file(network)
endif()
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()
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()
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()
trees.c
uncompr.c
zutil.c)
-
-# This code goes into libvnc.so, so it needs to be PIC on x86_64.
-# (It should be on other 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(zlib PROPERTIES COMPILE_FLAGS -fPIC)
-endif()