mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 04:53:28 +02:00
use -fsanitize=address in all code rather than just the top-level links
This commit is contained in:
parent
2056f588e3
commit
c25082d86f
46 changed files with 143 additions and 50 deletions
|
@ -213,3 +213,9 @@ endif ()
|
|||
if (ANDROID OR DESKTOP_GVR)
|
||||
add_subdirectory(gvr-interface)
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
|
||||
if (UNIX)
|
||||
MESSAGE("-- Memory debugging is enabled")
|
||||
endif (UNIX)
|
||||
endif ()
|
||||
|
|
|
@ -18,12 +18,7 @@ if (UNIX)
|
|||
endif (UNIX)
|
||||
|
||||
include_application_version()
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
||||
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
|
||||
if (UNIX)
|
||||
MESSAGE("-- assignment-client memory debugging is enabled.")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
endif (UNIX)
|
||||
endif ()
|
||||
setup_memory_debugger()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
21
cmake/macros/MemoryDebugger.cmake
Normal file
21
cmake/macros/MemoryDebugger.cmake
Normal file
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
# MemoryDebugger.cmake
|
||||
#
|
||||
# Copyright 2015 High Fidelity, Inc.
|
||||
#
|
||||
# Distributed under the Apache License, Version 2.0.
|
||||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
#
|
||||
|
||||
macro(SETUP_MEMORY_DEBUGGER)
|
||||
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
|
||||
SET( HIFI_MEMORY_DEBUGGING true )
|
||||
endif ()
|
||||
|
||||
if (HIFI_MEMORY_DEBUGGING)
|
||||
if (UNIX)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libasan -static-libstdc++ -fsanitize=address")
|
||||
endif (UNIX)
|
||||
endif ()
|
||||
endmacro(SETUP_MEMORY_DEBUGGER)
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME domain-server)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
if (UPPER_CMAKE_BUILD_TYPE MATCHES DEBUG AND NOT WIN32)
|
||||
set(_SHOULD_SYMLINK_RESOURCES TRUE)
|
||||
else ()
|
||||
|
@ -33,11 +35,3 @@ target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
|
|||
|
||||
include_application_version()
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
||||
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
|
||||
if (UNIX)
|
||||
MESSAGE("-- domain-server memory debugging is enabled.")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
endif (UNIX)
|
||||
endif ()
|
||||
|
|
|
@ -88,4 +88,6 @@ if (ANDROID)
|
|||
|
||||
endif (ANDROID)
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
setup_memory_debugger()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
set(TARGET_NAME ice-server)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# setup the project and link required Qt modules
|
||||
setup_hifi_project(Network)
|
||||
|
||||
# link the shared hifi libraries
|
||||
link_hifi_libraries(embedded-webserver networking shared)
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -205,12 +205,6 @@ else (APPLE)
|
|||
endif()
|
||||
endif (APPLE)
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
setup_memory_debugger()
|
||||
|
||||
if (DEFINED ENV{HIFI_MEMORY_DEBUGGING})
|
||||
if (UNIX)
|
||||
MESSAGE("-- interface memory debugging is enabled.")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||
endif (UNIX)
|
||||
endif ()
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -3,4 +3,6 @@ set(TARGET_NAME animation)
|
|||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Network Script)
|
||||
|
||||
link_hifi_libraries(shared gpu model fbx)
|
||||
setup_memory_debugger()
|
||||
|
||||
link_hifi_libraries(shared gpu model fbx)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME audio-client)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Network Multimedia)
|
||||
|
||||
|
@ -25,4 +27,4 @@ if (APPLE)
|
|||
find_library(CoreAudio CoreAudio)
|
||||
find_library(CoreFoundation CoreFoundation)
|
||||
target_link_libraries(${TARGET_NAME} ${CoreAudio} ${CoreFoundation})
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME audio)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Network)
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
set(TARGET_NAME auto-updater)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_library(Network)
|
||||
link_hifi_libraries(shared networking)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME avatars)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Network Script)
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME display-plugins)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(OpenGL)
|
||||
|
||||
|
@ -31,4 +33,4 @@ if (WIN32)
|
|||
find_package(OpenVR REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${OPENVR_INCLUDE_DIRS})
|
||||
target_link_libraries(${TARGET_NAME} ${OPENVR_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
set(TARGET_NAME embedded-webserver)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Network)
|
||||
setup_hifi_library(Network)
|
||||
|
|
|
@ -26,4 +26,6 @@ find_package(PolyVox REQUIRED)
|
|||
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${POLYVOX_INCLUDE_DIRS})
|
||||
target_link_libraries(${TARGET_NAME} ${POLYVOX_LIBRARIES})
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
link_hifi_libraries(shared gpu script-engine render render-utils)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME entities)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Network Script)
|
||||
|
||||
|
|
|
@ -7,4 +7,6 @@ add_dependency_external_projects(glm)
|
|||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared networking)
|
||||
setup_memory_debugger()
|
||||
|
||||
link_hifi_libraries(shared networking)
|
||||
|
|
|
@ -7,4 +7,6 @@ add_dependency_external_projects(glm)
|
|||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
link_hifi_libraries(shared gpu model networking octree)
|
||||
setup_memory_debugger()
|
||||
|
||||
link_hifi_libraries(shared gpu model networking octree)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME gpu)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
AUTOSCRIBE_SHADER_LIB(gpu)
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
|
|
|
@ -33,6 +33,8 @@ endif()
|
|||
#target_include_directories(${TARGET_NAME} PRIVATE ${SIXENSE_INCLUDE_DIRS})
|
||||
#target_link_libraries(${TARGET_NAME} ${SIXENSE_LIBRARIES})
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# perform standard include and linking for found externals
|
||||
foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
|
||||
|
||||
|
@ -69,4 +71,4 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
|
|||
add_definitions(-DSIXENSE_LIB_FILENAME=\"${${${EXTERNAL}_UPPERCASE}_LIBRARY_RELEASE}\")
|
||||
endif ()
|
||||
endif ()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
set(TARGET_NAME model)
|
||||
|
||||
|
||||
AUTOSCRIBE_SHADER_LIB(gpu model)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library()
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME networking)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Network)
|
||||
|
||||
|
@ -29,4 +31,4 @@ target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES} ${TBB_LIBRARIES})
|
|||
|
||||
# append tbb includes to our list of includes to bubble
|
||||
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${TBB_INCLUDE_DIRS})
|
||||
include_application_version()
|
||||
include_application_version()
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME octree)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library()
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME physics)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library()
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ link_hifi_libraries(shared)
|
|||
|
||||
add_dependency_external_projects(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
|
||||
|
|
|
@ -40,4 +40,6 @@ add_dependency_external_projects(oglplus)
|
|||
find_package(OGLPLUS REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${OGLPLUS_INCLUDE_DIRS})
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
link_hifi_libraries(animation fbx shared gpu model render environment)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME render)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
AUTOSCRIBE_SHADER_LIB(gpu model)
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
|
@ -21,4 +23,4 @@ if (WIN32)
|
|||
target_link_libraries(${TARGET_NAME} "${NSIGHT_LIBRARIES}")
|
||||
endif ()
|
||||
endif()
|
||||
endif (WIN32)
|
||||
endif (WIN32)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME script-engine)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
setup_hifi_library(Gui Network Script Widgets)
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(TARGET_NAME shared)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
# use setup_hifi_library macro to setup our project and link appropriate Qt modules
|
||||
# TODO: there isn't really a good reason to have Script linked here - let's get what is requiring it out (RegisteredMetaTypes.cpp)
|
||||
setup_hifi_library(Gui Network Script Widgets)
|
||||
|
|
|
@ -7,6 +7,7 @@ link_hifi_libraries(render-utils shared)
|
|||
|
||||
add_dependency_external_projects(glm)
|
||||
find_package(GLM REQUIRED)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
|
||||
|
||||
|
||||
|
|
|
@ -35,3 +35,5 @@ set_target_properties("all-tests" PROPERTIES FOLDER "hidden/test-targets")
|
|||
set_target_properties("all-tests" PROPERTIES
|
||||
EXCLUDE_FROM_DEFAULT_BUILD TRUE
|
||||
EXCLUDE_FROM_ALL TRUE)
|
||||
|
||||
setup_memory_debugger()
|
||||
|
|
|
@ -6,4 +6,6 @@ macro (setup_testcase_dependencies)
|
|||
copy_dlls_beside_windows_executable()
|
||||
endmacro ()
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_testcase()
|
||||
|
|
|
@ -6,4 +6,6 @@ macro (SETUP_TESTCASE_DEPENDENCIES)
|
|||
copy_dlls_beside_windows_executable()
|
||||
endmacro ()
|
||||
|
||||
setup_hifi_testcase()
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_testcase()
|
||||
|
|
|
@ -9,4 +9,6 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/")
|
|||
# link in the shared libraries
|
||||
link_hifi_libraries(entities avatars shared octree gpu model fbx networking animation environment)
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
setup_memory_debugger()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -7,4 +7,6 @@ macro (setup_testcase_dependencies)
|
|||
copy_dlls_beside_windows_executable()
|
||||
endmacro()
|
||||
|
||||
setup_hifi_testcase()
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_testcase()
|
||||
|
|
|
@ -7,4 +7,6 @@ macro (setup_testcase_dependencies)
|
|||
copy_dlls_beside_windows_executable()
|
||||
endmacro ()
|
||||
|
||||
setup_hifi_testcase()
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_testcase()
|
||||
|
|
|
@ -7,4 +7,6 @@ macro (setup_testcase_dependencies)
|
|||
copy_dlls_beside_windows_executable()
|
||||
endmacro ()
|
||||
|
||||
setup_hifi_testcase(Script Network)
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_testcase(Script Network)
|
||||
|
|
|
@ -21,4 +21,6 @@ macro (SETUP_TESTCASE_DEPENDENCIES)
|
|||
copy_dlls_beside_windows_executable()
|
||||
endmacro ()
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_testcase(Script)
|
||||
|
|
|
@ -9,4 +9,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Tests/manual-tests/")
|
|||
link_hifi_libraries(render-utils gpu shared)
|
||||
|
||||
message(${PROJECT_BINARY_DIR})
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -18,4 +18,7 @@ include_directories("${PROJECT_BINARY_DIR}/../../libraries/entities-renderer/")
|
|||
include_directories("${PROJECT_BINARY_DIR}/../../libraries/model/")
|
||||
|
||||
message(${PROJECT_BINARY_DIR})
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -8,4 +8,6 @@ macro (setup_testcase_dependencies)
|
|||
copy_dlls_beside_windows_executable()
|
||||
endmacro ()
|
||||
|
||||
setup_hifi_testcase()
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_testcase()
|
||||
|
|
|
@ -13,4 +13,6 @@ endif()
|
|||
# link in the shared libraries
|
||||
link_hifi_libraries(ui render-utils gpu shared)
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
setup_memory_debugger()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
setup_memory_debugger()
|
||||
|
||||
# add the tool directories
|
||||
add_subdirectory(mtc)
|
||||
set_target_properties(mtc PROPERTIES FOLDER "Tools")
|
||||
|
@ -7,4 +9,3 @@ set_target_properties(scribe PROPERTIES FOLDER "Tools")
|
|||
|
||||
add_subdirectory(vhacd-util)
|
||||
set_target_properties(vhacd-util PROPERTIES FOLDER "Tools")
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
set(TARGET_NAME mtc)
|
||||
setup_hifi_project()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
setup_memory_debugger()
|
||||
|
||||
copy_dlls_beside_windows_executable()
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
set(TARGET_NAME scribe)
|
||||
setup_hifi_project()
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
setup_hifi_project()
|
||||
|
|
|
@ -8,6 +8,8 @@ find_package(VHACD REQUIRED)
|
|||
target_include_directories(${TARGET_NAME} PUBLIC ${VHACD_INCLUDE_DIRS})
|
||||
target_link_libraries(${TARGET_NAME} ${VHACD_LIBRARIES})
|
||||
|
||||
setup_memory_debugger()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
include(FindOpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
|
|
Loading…
Reference in a new issue