Skip to content

Commit 6e18af1

Browse files
committed
Resolve merge conflicts
1 parent 240e649 commit 6e18af1

File tree

1 file changed

+1
-203
lines changed

1 file changed

+1
-203
lines changed

cmake/FindWebRTC.cmake

Lines changed: 1 addition & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<<<<<<< HEAD
21
########################################################################
32
# CMake module for finding WEBRTC
43
#
@@ -168,7 +167,7 @@ if(WEBRTC_INCLUDE_DIR)
168167
list(APPEND WEBRTC_INCLUDE_DIRS ${WEBRTC_INCLUDE_DIR} ${WEBRTC_INCLUDE_DIR}/third_party/boringssl/src/include)
169168
endif()
170169

171-
# workaround for fixing error WEBRTC_LIBRARY-NOTFOUND
170+
# Workaround for fixing error WEBRTC_LIBRARY-NOTFOUND
172171
set(WEBRTC_LIBRARY_RELEASE ${WEBRTC_LIBRARIES_RELEASE})
173172
set(WEBRTC_LIBRARY_DEBUG ${WEBRTC_LIBRARIES_DEBUG})
174173
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
@@ -203,204 +202,3 @@ mark_as_advanced(WEBRTC_LIBRARIES WEBRTC_INCLUDE_DIR
203202
WEBRTC_LIBRARIES_DEBUG WEBRTC_LIBRARIES_RELEASE
204203
WEBRTC_BUILD_DIR_SUFFIX_DEBUG WEBRTC_BUILD_DIR_SUFFIX_RELEASE
205204
WEBRTC_DEPENDENCIES)
206-
=======
207-
########################################################################
208-
# CMake module for finding WEBRTC
209-
#
210-
# The best way to build WebRTC is with the forked `webrtcbuilds` project here:
211-
# https://github.com/sourcey/webrtcbuilds
212-
#
213-
# The following variables will be defined:
214-
#
215-
# WEBRTC_FOUND
216-
# WEBRTC_INCLUDE_DIR
217-
# WEBRTC_LIBRARIES
218-
# WEBRTC_DEPENDENCIES
219-
#
220-
221-
# unset(WEBRTC_INCLUDE_DIR)
222-
# unset(WEBRTC_INCLUDE_DIR CACHE)
223-
# unset(WEBRTC_LIBRARY)
224-
# unset(WEBRTC_LIBRARY CACHE)
225-
# unset(WEBRTC_LIBRARIES)
226-
# unset(WEBRTC_LIBRARIES CACHE)
227-
# unset(WEBRTC_LIBRARIES_DEBUG)
228-
# unset(WEBRTC_LIBRARIES_DEBUG CACHE)
229-
# unset(WEBRTC_LIBRARIES_RELEASE)
230-
# unset(WEBRTC_LIBRARIES_RELEASE CACHE)
231-
232-
# Set required variables
233-
set(WEBRTC_ROOT_DIR "" CACHE STRING "Where is the WebRTC root directory located?")
234-
# set(WEBRTC_BUILD_DIR_SUFFIX_DEBUG "out/Debug" CACHE STRING "What is the WebRTC debug build directory suffix?")
235-
# set(WEBRTC_BUILD_DIR_SUFFIX_RELEASE "out/Release" CACHE STRING "What is the WebRTC release build directory suffix?")
236-
237-
# ----------------------------------------------------------------------
238-
# Find WEBRTC include path
239-
# ----------------------------------------------------------------------
240-
find_path(WEBRTC_INCLUDE_DIR
241-
NAMES
242-
webrtc/config.h
243-
PATHS
244-
${WEBRTC_ROOT_DIR}
245-
${WEBRTC_ROOT_DIR}/include
246-
$ENV{HOME}/tmp/webrtcbuilds/out/src
247-
$ENV{HOME}/sourcey/webrtcbuilds/out/src
248-
)
249-
250-
# ----------------------------------------------------------------------
251-
# Find WEBRTC libraries
252-
# ----------------------------------------------------------------------
253-
if(WEBRTC_INCLUDE_DIR)
254-
find_existing_directory(debug_dir
255-
${WEBRTC_ROOT_DIR}/lib/x64/Debug
256-
${WEBRTC_ROOT_DIR}/out/x64/Debug
257-
${WEBRTC_ROOT_DIR}/out/Debug_x64
258-
${WEBRTC_ROOT_DIR}/out/Debug-x64
259-
${WEBRTC_ROOT_DIR}/out/Debug)
260-
261-
find_existing_directory(release_dir
262-
${WEBRTC_ROOT_DIR}/lib/x64/Release
263-
${WEBRTC_ROOT_DIR}/out/x64/Release
264-
${WEBRTC_ROOT_DIR}/out/Release_x64
265-
${WEBRTC_ROOT_DIR}/out/Release-x64
266-
${WEBRTC_ROOT_DIR}/out/Release)
267-
268-
# Attempt to find the monolithic library built with `webrtcbuilds`
269-
find_library_extended(WEBRTC
270-
NAMES webrtc webrtc_full libwebrtc_full
271-
PATHS_DEBUG ${debug_dir}
272-
PATHS_RELEASE ${release_dir}
273-
)
274-
275-
# # Otherwise generate a library from available .o objects
276-
# if(NOT WEBRTC_LIBRARY)
277-
# if(EXISTS ${_WEBRTC_BUILD_DIR_DEBUG})
278-
# message("Generating WebRTC Debug library")
279-
# set(lib_cmd "${LibSourcey_DIR}/cmake/webrtc_lib_generator.sh" -o ${_WEBRTC_BUILD_DIR_DEBUG} -x ${_WEBRTC_GENERATOR_EXCLUDES})
280-
# execute_process(COMMAND ${lib_cmd})
281-
# endif()
282-
#
283-
# if(EXISTS ${_WEBRTC_BUILD_DIR_RELEASE})
284-
# message("Generating WebRTC Release library")
285-
# set(lib_cmd "${LibSourcey_DIR}/cmake/webrtc_lib_generator.sh" -o ${_WEBRTC_BUILD_DIR_RELEASE} -x ${_WEBRTC_GENERATOR_EXCLUDES})
286-
# execute_process(COMMAND ${lib_cmd})
287-
# endif()
288-
#
289-
# # Attempt to find our library again...
290-
# find_library_extended(WEBRTC
291-
# NAMES webrtc_scy
292-
# PATHS_DEBUG ${_WEBRTC_BUILD_DIR_DEBUG}
293-
# PATHS_RELEASE ${_WEBRTC_BUILD_DIR_RELEASE}
294-
# )
295-
# endif()
296-
297-
# Otherwise fallback to library objects (slower and unreliable)
298-
if(NOT WEBRTC_LIBRARIES)
299-
#unset(WEBRTC_LIBRARY CACHE)
300-
#unset(WEBRTC_LIBRARIES CACHE)
301-
#set(WEBRTC_LIBRARIES "")
302-
303-
if(MSVC)
304-
set(lib_suffix "lib")
305-
else()
306-
set(lib_suffix "a")
307-
endif()
308-
309-
# obj/third_party/boringssl/libboringssl.a
310-
# obj/third_party/protobuf/libprotobuf_full.a
311-
# obj/webrtc/system_wrappers/libfield_trial_default.a
312-
# obj/webrtc/system_wrappers/libmetrics_default.a
313-
# obj/webrtc/libwebrtc.a
314-
315-
set(_WEBRTC_DEPENDENCY_INCLUDES "webrtc\\.a|boringssl|protobuf_full|field_trial_default|metrics_default") #|common|video|media
316-
317-
# Debug
318-
if (EXISTS ${debug_dir})
319-
file(GLOB_RECURSE debug_libs "${debug_dir}/*.${lib_suffix}")
320-
foreach(lib ${debug_libs})
321-
# if(${lib} NOT MATCHES ${_WEBRTC_DEPENDENCY_EXCLUDES})
322-
if(${lib} MATCHES ${_WEBRTC_DEPENDENCY_INCLUDES})
323-
list(APPEND WEBRTC_LIBRARIES_DEBUG ${lib})
324-
endif()
325-
# endif()
326-
endforeach()
327-
foreach(lib ${WEBRTC_LIBRARIES_DEBUG})
328-
if(WIN32 AND (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
329-
list(APPEND WEBRTC_LIBRARIES "debug" ${lib})
330-
else()
331-
list(APPEND WEBRTC_LIBRARIES ${lib})
332-
endif()
333-
endforeach()
334-
endif()
335-
336-
# Release
337-
if (EXISTS ${release_dir})
338-
file(GLOB_RECURSE release_libs "${release_dir}/*.${lib_suffix}")
339-
foreach(lib ${release_libs})
340-
# if(${lib} NOT MATCHES ${_WEBRTC_DEPENDENCY_EXCLUDES})
341-
if(${lib} MATCHES ${_WEBRTC_DEPENDENCY_INCLUDES})
342-
list(APPEND WEBRTC_LIBRARIES_RELEASE ${lib})
343-
endif()
344-
endforeach()
345-
foreach(lib ${WEBRTC_LIBRARIES_RELEASE})
346-
if(WIN32 AND (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
347-
list(APPEND WEBRTC_LIBRARIES "optimized" ${lib})
348-
else()
349-
list(APPEND WEBRTC_LIBRARIES ${lib})
350-
endif()
351-
endforeach()
352-
endif()
353-
endif()
354-
355-
# Add required system libraries
356-
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND MSVC)
357-
add_definitions(-DWEBRTC_WIN)
358-
set(WEBRTC_DEPENDENCIES Secur32.lib Winmm.lib msdmo.lib dmoguids.lib wmcodecdspuuid.lib) # strmbase.lib
359-
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
360-
add_definitions(-DWEBRTC_POSIX)
361-
362-
# For ABI compatability between precompiled WebRTC libraries using clang and new GCC versions
363-
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
364-
set(WEBRTC_DEPENDENCIES -lrt -lX11 -lGLU) # -lGL
365-
366-
# Enable libstdc++ debugging if you build WebRTC with `enable_iterator_debugging=true`
367-
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG=1")
368-
endif()
369-
370-
# Add vendor include directories
371-
if(WEBRTC_INCLUDE_DIR)
372-
list(APPEND WEBRTC_INCLUDE_DIRS ${WEBRTC_INCLUDE_DIR} ${WEBRTC_INCLUDE_DIR}/third_party/boringssl/src/include)
373-
endif()
374-
375-
# workaround for fixing error WEBRTC_LIBRARY-NOTFOUND
376-
set(WEBRTC_LIBRARY_RELEASE ${WEBRTC_LIBRARIES_RELEASE})
377-
set(WEBRTC_LIBRARY_DEBUG ${WEBRTC_LIBRARIES_DEBUG})
378-
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
379-
select_library_configurations(WEBRTC)
380-
381-
# message("WEBRTC_LIBRARIES_DEBUG: ${WEBRTC_LIBRARIES_DEBUG}")
382-
# message("WEBRTC_LIBRARIES_RELEASE: ${WEBRTC_LIBRARIES_RELEASE}")
383-
# message("WEBRTC_LIBRARIES: ${WEBRTC_LIBRARIES}")
384-
endif()
385-
386-
# ----------------------------------------------------------------------
387-
# Display status
388-
# ----------------------------------------------------------------------
389-
include(FindPackageHandleStandardArgs)
390-
find_package_handle_standard_args(WEBRTC DEFAULT_MSG WEBRTC_LIBRARIES WEBRTC_INCLUDE_DIR)
391-
392-
# print_module_variables(WEBRTC)
393-
394-
# HACK: WEBRTC_LIBRARIES and WEBRTC_DEPENDENCIES not propagating to parent scope
395-
# while the WEBRTC_DEBUG_LIBRARY and WEBRTC_RELEASE_LIBRARY vars are.
396-
# Setting PARENT_SCOPE fixes this solves theis issue for now.
397-
set(WEBRTC_LIBRARIES ${WEBRTC_LIBRARIES} CACHE INTERNAL "")
398-
set(WEBRTC_DEPENDENCIES ${WEBRTC_DEPENDENCIES} CACHE INTERNAL "")
399-
set(WEBRTC_INCLUDE_DIRS ${WEBRTC_INCLUDE_DIRS} CACHE INTERNAL "")
400-
set(WEBRTC_FOUND ${WEBRTC_FOUND} CACHE INTERNAL "")
401-
402-
mark_as_advanced(WEBRTC_LIBRARIES WEBRTC_INCLUDE_DIR
403-
WEBRTC_LIBRARIES_DEBUG WEBRTC_LIBRARIES_RELEASE
404-
WEBRTC_BUILD_DIR_SUFFIX_DEBUG WEBRTC_BUILD_DIR_SUFFIX_RELEASE
405-
WEBRTC_DEPENDENCIES)
406-
>>>>>>> 5bdee0ed0e745fe0c54636d496039cfab20e228a

0 commit comments

Comments
 (0)