Define BUILD_SHARED_LIBS flag, which will define LIBRARY_TYPE variable

This commit is contained in:
Axel Isouard 2017-02-05 06:28:20 -08:00
parent fc819a24b6
commit 7c4895a6fd
No known key found for this signature in database
GPG key ID: D30914735883C824
2 changed files with 9 additions and 4 deletions

View file

@ -37,11 +37,16 @@ set(LIBWEBRTC_VERSION
${LIBWEBRTC_API_VERSION}${LIBWEBRTC_BUILD_VERSION}) ${LIBWEBRTC_API_VERSION}${LIBWEBRTC_BUILD_VERSION})
# #
# Options # Options, flags
#
option(BUILD_TESTS "Build test binaries" OFF) option(BUILD_TESTS "Build test binaries" OFF)
set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass before compiling WebRTC") set(NINJA_ARGS "" CACHE STRING "Ninja arguments to pass before compiling WebRTC")
option(BUILD_SHARED_LIBS "Build WebRTC as a shared library." OFF)
if(BUILD_SHARED_LIBS)
set(LIBRARY_TYPE SHARED)
else()
set(LIBRARY_TYPE STATIC)
endif()
# #
# Offer the user the choice of overriding the installation directories # Offer the user the choice of overriding the installation directories

View file

@ -35,7 +35,7 @@ if (${LIBWEBRTC_OBJ_EXCLUDED_LEN} GREATER "0")
list(REMOVE_ITEM LIBWEBRTC_OBJ_FILES ${LIBWEBRTC_OBJ_EXCLUDED}) list(REMOVE_ITEM LIBWEBRTC_OBJ_FILES ${LIBWEBRTC_OBJ_EXCLUDED})
endif () endif ()
add_library(webrtc STATIC ${LIBWEBRTC_OBJ_FILES}) add_library(webrtc ${LIBRARY_TYPE} ${_OBJ_FILES})
set_source_files_properties(${LIBWEBRTC_OBJ_FILES} PROPERTIES set_source_files_properties(${LIBWEBRTC_OBJ_FILES} PROPERTIES
EXTERNAL_OBJECT true EXTERNAL_OBJECT true