Commit 82fc7076 authored by Ghislain MARY's avatar Ghislain MARY

Do not use object library when building with CMake.

parent 98781330
......@@ -83,11 +83,8 @@ endif()
apply_compile_flags(ORTP_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(ORTP_SOURCE_FILES_CXX "CPP" "CXX")
add_library(ortp-objects OBJECT ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES_C} ${ORTP_SOURCE_FILES_CXX})
set_target_properties(ortp-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
if(ENABLE_STATIC)
add_library(ortp-static STATIC $<TARGET_OBJECTS:ortp-objects>)
add_library(ortp-static STATIC ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES_C} ${ORTP_SOURCE_FILES_CXX})
set_target_properties(ortp-static PROPERTIES OUTPUT_NAME ortp)
target_link_libraries(ortp-static ${LIBS})
install(TARGETS ortp-static EXPORT ${EXPORT_TARGETS_NAME}Targets
......@@ -96,7 +93,7 @@ if(ENABLE_STATIC)
)
endif()
if(ENABLE_SHARED)
add_library(ortp SHARED $<TARGET_OBJECTS:ortp-objects>)
add_library(ortp SHARED ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES_C} ${ORTP_SOURCE_FILES_CXX})
set_target_properties(ortp PROPERTIES VERSION ${ORTP_SO_VERSION})
target_link_libraries(ortp ${LIBS})
if(MSVC)
......
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