mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Add sanitizer options.
Fix mac default folders locations like rings and belr grammars.
This commit is contained in:
parent
42799127b0
commit
3488f97ed8
4 changed files with 23 additions and 22 deletions
|
|
@ -98,6 +98,7 @@ option(ENABLE_BUILD_EXAMPLES "Enable the build of examples" NO)
|
|||
option(ENABLE_BUILD_VERBOSE "Enable the build generation to be more verbose" NO)
|
||||
option(ENABLE_DAEMON "Enable the linphone daemon interface." NO)
|
||||
option(ENABLE_FFMPEG "Build mediastreamer2 with ffmpeg video support." ON)
|
||||
option(ENABLE_SANITIZER "Enable sanitizer." NO)
|
||||
option(ENABLE_STRICT "Build with strict compilator flags e.g. -Wall -Werror" NO)
|
||||
option(ENABLE_TESTS "Build with testing binaries of SDK" NO )
|
||||
option(ENABLE_TESTS_COMPONENTS "Build libbctoolbox-tester" NO )
|
||||
|
|
@ -131,6 +132,7 @@ list(APPEND APP_OPTIONS "-DENABLE_UNIT_TESTS=${ENABLE_UNIT_TESTS}")
|
|||
list(APPEND APP_OPTIONS "-DENABLE_TESTS=${ENABLE_TESTS}")
|
||||
list(APPEND APP_OPTIONS "-DENABLE_TESTS_COMPONENTS=${ENABLE_TESTS_COMPONENTS}")
|
||||
list(APPEND APP_OPTIONS "-DENABLE_TOOLS=${ENABLE_TOOLS}")
|
||||
list(APPEND APP_OPTIONS "-DENABLE_SANITIZER=${ENABLE_SANITIZER}")
|
||||
list(APPEND APP_OPTIONS "-DENABLE_STRICT=${ENABLE_STRICT}")
|
||||
list(APPEND APP_OPTIONS "-DENABLE_FFMPEG=${ENABLE_FFMPEG}")
|
||||
list(APPEND APP_OPTIONS "-DENABLE_BUILD_VERBOSE=${ENABLE_BUILD_VERBOSE}")
|
||||
|
|
|
|||
|
|
@ -89,18 +89,6 @@ if(ENABLE_BUILD_VERBOSE)
|
|||
endif()
|
||||
# Build configuration
|
||||
|
||||
#############################
|
||||
#Sanitizer
|
||||
if(ENABLE_SANITIZER)
|
||||
set(sanitize_flags "-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
||||
set(sanitize_linker_flags "-fsanitize=address,undefined")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${sanitize_flags}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${sanitize_flags}")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
endif()
|
||||
#############################
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -DQT_NO_DEBUG")
|
||||
|
|
@ -110,14 +98,21 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_
|
|||
#############################
|
||||
#Sanitizer
|
||||
if(ENABLE_SANITIZER)
|
||||
set(sanitize_flags "-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
||||
set(sanitize_linker_flags "-fsanitize=address,undefined")
|
||||
if(MSVC)
|
||||
set(sanitize_flags "/fsanitize=address /Oy-")
|
||||
else()
|
||||
set(sanitize_flags "-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${sanitize_flags}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${sanitize_flags}")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
if(NOT MSVC)
|
||||
set(sanitize_linker_flags "-fsanitize=address,undefined")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${sanitize_linker_flags}")
|
||||
endif()
|
||||
endif()
|
||||
#############################
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,14 @@ if (WIN32)
|
|||
LIBRARY DESTINATION "${LIBDIR}"
|
||||
RUNTIME DESTINATION "${LIBDIR}"
|
||||
)
|
||||
|
||||
if(ENABLE_SANITIZER AND MSVC)
|
||||
if( CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
find_file(SANITIZER_LIB clang_rt.asan_dynamic-x86_64.dll)
|
||||
else()
|
||||
find_file(SANITIZER_LIB clang_rt.asan_dynamic-i386.dll)
|
||||
endif()
|
||||
install(FILES "${SANITIZER_LIB}" DESTINATION "${CMAKE_INSTALL_BINDIR}/")
|
||||
endif()
|
||||
##############################
|
||||
|
||||
set(BIN_ARCH "win32")
|
||||
|
|
@ -193,10 +200,7 @@ elseif (APPLE)
|
|||
endforeach(item)
|
||||
endif()
|
||||
install(FILES ${SHARED_LIBRARIES} DESTINATION "${APPLICATION_NAME}.app/Contents/Frameworks")
|
||||
file(GLOB GRAMMAR_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Belr/grammars/*")
|
||||
install(FILES ${GRAMMAR_FILES} DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/")
|
||||
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/images" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS OPTIONAL)
|
||||
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/sounds/linphone/" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}/sounds/${EXECUTABLE_NAME}" USE_SOURCE_PERMISSIONS)
|
||||
install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Linphone/rootca.pem" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}")
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../../assets/linphonerc-factory" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}")
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit ba15d5d1862543b073d878c77b5c91babfe6abf4
|
||||
Subproject commit b9e9ed67872864dfcb802825a04678fea3f316a1
|
||||
Loading…
Add table
Reference in a new issue