diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d1baec..bdabdcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,11 +37,16 @@ set(LIBWEBRTC_VERSION ${LIBWEBRTC_API_VERSION}${LIBWEBRTC_BUILD_VERSION}) # -# Options -# - +# Options, flags option(BUILD_TESTS "Build test binaries" OFF) 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 diff --git a/Targets/libwebrtc/CMakeLists.txt b/Targets/libwebrtc/CMakeLists.txt index 46b6920..4392255 100644 --- a/Targets/libwebrtc/CMakeLists.txt +++ b/Targets/libwebrtc/CMakeLists.txt @@ -35,7 +35,7 @@ if (${LIBWEBRTC_OBJ_EXCLUDED_LEN} GREATER "0") list(REMOVE_ITEM LIBWEBRTC_OBJ_FILES ${LIBWEBRTC_OBJ_EXCLUDED}) endif () -add_library(webrtc STATIC ${LIBWEBRTC_OBJ_FILES}) +add_library(webrtc ${LIBRARY_TYPE} ${_OBJ_FILES}) set_source_files_properties(${LIBWEBRTC_OBJ_FILES} PROPERTIES EXTERNAL_OBJECT true