Commit 7e2f2de4 authored by Peio Rigaux's avatar Peio Rigaux

redefine properly the android api in CMakeList instead of redefining the api...

redefine properly the android api in CMakeList instead of redefining the api for each project. Cleaning CMake flags to prevent obsolete cache value from being used. Temporarily duplicated sanitizer flags definition while we can't get them properly from cache
parent 8a87f0ab
......@@ -21,6 +21,37 @@
############################################################################
cmake_minimum_required(VERSION 3.0)
#Builds aaudio with android sdk 28 while others projects are builds with another version
#(defined in cmake builer toolchain android file)
#This systems ensures a retrocompatible build, and the activation of new features ONLY
#on devices supporting it
set(ANDROID_PLATFORM "android-28" CACHE STRING "" FORCE)
#Needed to take priority over cache to redefine android sdk version with ANDROID_PLATFORM
#Otherwize, the sdk version is replaced by the cmake builder toolchain android default one
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "")
set(CMAKE_EXE_LINKER_FLAGS "")
set(CMAKE_SHARED_LINKER_FLAGS "")
set(CMAKE_MODULE_LINKER_FLAGS "")
if(ENABLE_SANITIZER)
message(WARNING "CODE DUPLICATION : duplication of sanitizer flags ! TODO use config-sanitizer instead for linphone-sdk 5.0 ! ")
set(sanitize_flags "-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wl,-llog")
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()
project(MSAAUDIO VERSION 0.1 LANGUAGES CXX)
option(ENABLE_SHARED "Build shared library." YES)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment