summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrown, Matthew <matthew.brown@nuance.com>2016-09-26 16:47:53 -0400
committerAndy Green <andy@warmcat.com>2016-09-27 05:36:02 +0800
commit1fc082eb7f6aa92bad74bd70dc54df8401558b6a (patch)
tree47b451637042d39e1b547bbdfcf6b395478e1246
parent47671fe50433a344609d845e5876bfda168a81ba (diff)
downloadlibwebsockets-1fc082eb7f6aa92bad74bd70dc54df8401558b6a.tar.gz
libwebsockets-1fc082eb7f6aa92bad74bd70dc54df8401558b6a.tar.bz2
libwebsockets-1fc082eb7f6aa92bad74bd70dc54df8401558b6a.zip
Added option to build the static library with PIC
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 83defae6..bf3a97b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.9)
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
@@ -87,6 +87,7 @@ option(LWS_IPV6 "Compile with support for ipv6" OFF)
option(LWS_WITH_HTTP2 "Compile with support for http2" OFF)
option(LWS_MBED3 "Platform is MBED3" OFF)
option(LWS_SSL_SERVER_WITH_ECDH_CERT "Include SSL server use ECDH certificate" OFF)
+option(LWS_STATIC_PIC "Build the static version of the library with position-independent code" OFF)
if (DEFINED YOTTA_WEBSOCKETS_VERSION_STRING)
@@ -543,6 +544,9 @@ source_group("Sources" FILES ${SOURCES})
set(LWS_LIBRARIES)
if (LWS_WITH_STATIC)
+ if (LWS_STATIC_PIC)
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+ endif()
add_library(websockets STATIC
${HDR_PRIVATE}
${HDR_PUBLIC}
@@ -1224,6 +1228,7 @@ message(" LWS_MBED3 = ${LWS_MBED3}")
message(" LWS_SSL_SERVER_WITH_ECDH_CERT = ${LWS_SSL_SERVER_WITH_ECDH_CERT}")
message(" LWS_MAX_SMP = ${LWS_MAX_SMP}")
message(" LWS_HAVE_OPENSSL_ECDH_H = ${LWS_HAVE_OPENSSL_ECDH_H}")
+message(" LWS_STATIC_PIC = ${LWS_STATIC_PIC}")
message("---------------------------------------------------------------------")
# These will be available to parent projects including libwebsockets using add_subdirectory()