Commit 97c7c246 authored by Uilian Ries's avatar Uilian Ries

Make fPIC optional

Signed-off-by: default avatarUilian Ries <uilianries@gmail.com>
parent 5b29016c
......@@ -29,6 +29,7 @@ option(PISTACHE_BUILD_EXAMPLES "build examples alongside the project" OFF)
option(PISTACHE_BUILD_DOCS "build docs alongside the project" OFF)
option(PISTACHE_INSTALL "add pistache as install target (recommended)" ON)
option(PISTACHE_USE_SSL "add support for SSL server" OFF)
option(PISTACHE_PIC "Enable pistache PIC" ON)
# require fat LTO objects in static library
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION OR CMAKE_CXX_FLAGS MATCHES "-flto" OR CMAKE_CXX_FLAGS MATCHES "-flto=thin")
......
......@@ -12,7 +12,7 @@ set(SOURCE_FILES
)
add_library(pistache OBJECT ${SOURCE_FILES})
set_target_properties(pistache PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(pistache PROPERTIES POSITION_INDEPENDENT_CODE $<BOOL:${PISTACHE_PIC}>)
add_definitions(-DONLY_C_LOCALE=1)
set(PISTACHE_INCLUDE
......@@ -56,7 +56,7 @@ if (BUILD_SHARED_LIBS)
)
endif ()
set_target_properties(pistache_static PROPERTIES
set_target_properties(pistache_static PROPERTIES
OUTPUT_NAME ${Pistache_OUTPUT_NAME}
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment