cmake: fix compilation in lib
Need to add -fPIC to objects that will be put in a shared library.
This commit is contained in:
parent
8c46d9181f
commit
0afc21c9d8
|
@ -25,8 +25,10 @@ set(NGHTTP2_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(nghttp2-obj OBJECT ${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>)
|
add_library(nghttp2 SHARED $<TARGET_OBJECTS:nghttp2-obj>)
|
||||||
#target_link_libraries(nghttp2 ...)
|
|
||||||
set_target_properties(nghttp2 PROPERTIES
|
set_target_properties(nghttp2 PROPERTIES
|
||||||
COMPILE_FLAGS "${WARNCFLAGS} ${EXTRACFLAG}"
|
COMPILE_FLAGS "${WARNCFLAGS} ${EXTRACFLAG}"
|
||||||
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION})
|
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION})
|
||||||
|
|
Loading…
Reference in New Issue