mirror of
https://github.com/UltraCoderRU/libwebrtc.git
synced 2026-01-28 03:15:11 +00:00
Build with dynamic runtime on desktop Windows
Add suffix to debug library name
This commit is contained in:
parent
b248e1cd73
commit
5ac8845681
4 changed files with 23 additions and 4 deletions
6
CMakeModules/PatchWebRTC.cmake
Normal file
6
CMakeModules/PatchWebRTC.cmake
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
set(TARGET_FILE ${CMAKE_ARGV3})
|
||||
|
||||
file(READ ${TARGET_FILE} filedata)
|
||||
string(REGEX REPLACE ":static_crt" ":dynamic_crt" filedata "${filedata}")
|
||||
file(WRITE ${TARGET_FILE} "${filedata}")
|
||||
|
|
@ -84,10 +84,10 @@ if (UNIX)
|
|||
endif (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
list(APPEND LIBWEBRTC_DEFINITIONS WEBRTC_POSIX _GLIBCXX_USE_CXX11_ABI=0)
|
||||
elseif (WIN32)
|
||||
set(LIBWEBRTC_REQUIRED_C_FLAGS_DEBUG "/MTd")
|
||||
set(LIBWEBRTC_REQUIRED_C_FLAGS_RELEASE "/MT")
|
||||
set(LIBWEBRTC_REQUIRED_CXX_FLAGS_DEBUG "/MTd")
|
||||
set(LIBWEBRTC_REQUIRED_CXX_FLAGS_RELEASE "/MT")
|
||||
set(LIBWEBRTC_REQUIRED_C_FLAGS_DEBUG "/MDd")
|
||||
set(LIBWEBRTC_REQUIRED_C_FLAGS_RELEASE "/MD")
|
||||
set(LIBWEBRTC_REQUIRED_CXX_FLAGS_DEBUG "/MDd")
|
||||
set(LIBWEBRTC_REQUIRED_CXX_FLAGS_RELEASE "/MD")
|
||||
list(APPEND LIBWEBRTC_DEFINITIONS WEBRTC_WIN NOMINMAX _CRT_SECURE_NO_WARNINGS)
|
||||
endif (UNIX)
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ if (${_OBJ_EXCLUDED_LEN} GREATER "0")
|
|||
list(REMOVE_ITEM _OBJ_FILES ${_OBJ_EXCLUDED})
|
||||
endif ()
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
|
||||
add_library(webrtc STATIC ${_OBJ_FILES})
|
||||
|
||||
set_source_files_properties(${_OBJ_FILES} PROPERTIES
|
||||
|
|
|
|||
|
|
@ -134,6 +134,17 @@ libwebrtc_command(
|
|||
)
|
||||
set(_DEPENDENCIES ${_DEPENDENCIES} webrtc-clang-format)
|
||||
|
||||
if (WIN32)
|
||||
libwebrtc_command(
|
||||
NAME webrtc-patch-crt
|
||||
COMMAND ${CMAKE_COMMAND} -P ${WEBRTC_PARENT_DIR}/../../CMakeModules/PatchWebRTC.cmake ${WEBRTC_PARENT_DIR}/src/build/config/win/BUILD.gn
|
||||
WORKING_DIRECTORY "${WEBRTC_PARENT_DIR}"
|
||||
COMMENT "Patching webrtc to use dynamic runtime"
|
||||
DEPENDS webrtc-sync
|
||||
)
|
||||
set(_DEPENDENCIES ${_DEPENDENCIES} webrtc-patch-crt)
|
||||
endif()
|
||||
|
||||
include(Gn)
|
||||
|
||||
libwebrtc_command(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue