Commit 0afc21c9 authored by Peter Wu's avatar Peter Wu

cmake: fix compilation in lib

Need to add -fPIC to objects that will be put in a shared library.
parent 8c46d918
......@@ -25,8 +25,10 @@ set(NGHTTP2_SOURCES
)
add_library(nghttp2-obj OBJECT ${NGHTTP2_SOURCES})
# Needed because the object files are linked into a shared library.
set_target_properties(nghttp2-obj PROPERTIES
POSITION_INDEPENDENT_CODE ON)
add_library(nghttp2 SHARED $<TARGET_OBJECTS:nghttp2-obj>)
#target_link_libraries(nghttp2 ...)
set_target_properties(nghttp2 PROPERTIES
COMPILE_FLAGS "${WARNCFLAGS} ${EXTRACFLAG}"
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION})
......
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