From 726079e7fec6d38615e0bf7f48d0eb0b42bdedf6 Mon Sep 17 00:00:00 2001 From: eroen Date: Sun, 21 Oct 2012 11:40:50 +0200 Subject: Compile static library as PIC Otherwise, when linked against shared libraries, position dependent code is included. Cross-platform support for handling this was added in cmake 2.8.9. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 0795081..49cf388 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR) project(clsocket) # set up versioning. @@ -67,6 +67,7 @@ else() else() ADD_LIBRARY(clsocket STATIC ${CLSOCKET_SOURCES}) endif() + set_target_properties(clsocket PROPERTIES POSITION_INDEPENDENT_CODE True) endif() TARGET_LINK_LIBRARIES(clsocket ${PROJECT_LIBS}) -- cgit v1.2.1