mirror of
https://github.com/overte-org/overte.git
synced 2025-06-02 03:41:08 +02:00
Fix memory debugging.
* Disables WebRTC (build fails) * Recommends disabling optimization * Recommends enabling debugging * Remove forced optimization from plugins
This commit is contained in:
parent
720c0269e6
commit
bb1331c0cb
5 changed files with 31 additions and 6 deletions
|
@ -15,10 +15,25 @@ if ("$ENV{OVERTE_MEMORY_DEBUGGING}")
|
||||||
message(FATAL_ERROR "Thread debugging and memory debugging can't be enabled at the same time." )
|
message(FATAL_ERROR "Thread debugging and memory debugging can't be enabled at the same time." )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (OVERTE_OPTIMIZE)
|
||||||
|
message(WARNING "You should consider building without optimization by passing -DOVERTE_OPTIMIZE=false to CMake")
|
||||||
|
endif()
|
||||||
|
if (NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
message(WARNING "You should consider building with debugging enabled by passing -DCMAKE_BUILD_TYPE=Debug to CMake. Current type is ${CMAKE_BUILD_TYPE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
SET( OVERTE_MEMORY_DEBUGGING true )
|
SET( OVERTE_MEMORY_DEBUGGING true )
|
||||||
|
SET ( DISABLE_WEBRTC true )
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if ( OVERTE_MEMORY_DEBUGGING)
|
if ( OVERTE_MEMORY_DEBUGGING)
|
||||||
|
# WebRTC doesn't work with memory debugging enabled, it fails to link:
|
||||||
|
# /usr/bin/ld: ../../libraries/networking/libnetworking.so: undefined reference to `typeinfo for rtc::Thread'
|
||||||
|
# /usr/bin/ld: ../../libraries/networking/libnetworking.so: undefined reference to `typeinfo for webrtc::SessionDescriptionInterface'
|
||||||
|
# /usr/bin/ld: ../../libraries/networking/libnetworking.so: undefined reference to `typeinfo for webrtc::IceCandidateInterface'
|
||||||
|
add_compile_definitions(DISABLE_WEBRTC)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -fsanitize-recover=address")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -fsanitize-recover=address")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize-recover=address")
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined -fsanitize=address -fsanitize-recover=address")
|
||||||
|
|
|
@ -14,7 +14,11 @@ include_hifi_library_headers(script-engine)
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
else ()
|
else ()
|
||||||
target_webrtc()
|
if (NOT DISABLE_WEBRTC )
|
||||||
|
target_webrtc()
|
||||||
|
else()
|
||||||
|
message(WARNING "WebRTC is supported on this platform but has been disabled for this build (likely memory debugging)")
|
||||||
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# append audio includes to our list of includes to bubble
|
# append audio includes to our list of includes to bubble
|
||||||
|
|
|
@ -8,7 +8,11 @@ add_crashpad()
|
||||||
target_breakpad()
|
target_breakpad()
|
||||||
|
|
||||||
if (WIN32 OR (UNIX AND NOT APPLE))
|
if (WIN32 OR (UNIX AND NOT APPLE))
|
||||||
target_webrtc()
|
if (NOT DISABLE_WEBRTC )
|
||||||
|
target_webrtc()
|
||||||
|
else()
|
||||||
|
message(WARNING "WebRTC is supported on this platform but has been disabled for this build (likely memory debugging)")
|
||||||
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
|
@ -37,9 +37,11 @@
|
||||||
// # define WEBRTC_POSIX 1
|
// # define WEBRTC_POSIX 1
|
||||||
// # define WEBRTC_LEGACY 1
|
// # define WEBRTC_LEGACY 1
|
||||||
#elif defined(Q_OS_LINUX) && defined(Q_PROCESSOR_X86_64)
|
#elif defined(Q_OS_LINUX) && defined(Q_PROCESSOR_X86_64)
|
||||||
# define WEBRTC_AUDIO 1
|
# ifndef DISABLE_WEBRTC
|
||||||
# define WEBRTC_POSIX 1
|
# define WEBRTC_AUDIO 1
|
||||||
# define WEBRTC_DATA_CHANNELS 1
|
# define WEBRTC_POSIX 1
|
||||||
|
# define WEBRTC_DATA_CHANNELS 1
|
||||||
|
# endif
|
||||||
#elif defined(Q_OS_LINUX) && defined(Q_PROCESSOR_ARM)
|
#elif defined(Q_OS_LINUX) && defined(Q_PROCESSOR_ARM)
|
||||||
// WebRTC is basically impossible to build on aarch64 Linux.
|
// WebRTC is basically impossible to build on aarch64 Linux.
|
||||||
// I am looking at https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing for an alternative.
|
// I am looking at https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing for an alternative.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# add the plugin directories
|
# add the plugin directories
|
||||||
file(GLOB PLUGIN_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
file(GLOB PLUGIN_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
||||||
list(REMOVE_ITEM PLUGIN_SUBDIRS "CMakeFiles")
|
list(REMOVE_ITEM PLUGIN_SUBDIRS "CMakeFiles")
|
||||||
set(CMAKE_BUILD_TYPE "Release")
|
|
||||||
# client-side plugins
|
# client-side plugins
|
||||||
if (NOT SERVER_ONLY AND NOT ANDROID)
|
if (NOT SERVER_ONLY AND NOT ANDROID)
|
||||||
if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
|
||||||
|
|
Loading…
Reference in a new issue