From c9f407127228415e71df9d70bb5ee8cc399a9261 Mon Sep 17 00:00:00 2001 From: fengmao31 Date: Thu, 15 Dec 2022 13:32:50 +0800 Subject: [PATCH] update CMakelist.text --- CMakeLists.txt | 84 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6c02c2..9ece124 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,35 @@ # INSTALL ( TARGETS ts_mixer DESTINATION lib ) +# cmake_minimum_required(VERSION 3.10) +# project(unitest_mixer) + +# set(CMAKE_CXX_STANDARD 17) +# set(CMAKE_CXX_FLAGS "-g") # 调试信息 set(CMAKE_CXX_FLAGS "-Wall") # 开启所有警告 +# set(CMAKE_BUILD_TYPE "Debug") +# set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -fPIC -O0 -Wall -g2 -ggdb") + +# ADD_DEFINITIONS(-DWEBRTC_LINUX -DWEBRTC_POSIX) +# #add_definitions(-DABSL_STRINGS_STRING_VIEW_H_) + +# AUX_SOURCE_DIRECTORY(. mixer) +# include_directories(.) +# include_directories(third_party/abseil-cpp) + +# add_executable(unitest_mixer +# unitest_mixer.cc +# MixerImpl.cpp +# ${mixer} +# ) + +# target_link_libraries(unitest_mixer +# /home/fengmao/cowa_audio/backup_git/webrtc_mixer/libts_mixer.a +# pthread +# ) + + +cmake_minimum_required(VERSION 3.10) project(unitest_mixer) set(CMAKE_CXX_STANDARD 17) @@ -71,14 +99,49 @@ set(CMAKE_CXX_FLAGS "-g") # 调试信息 set(CMAKE_CXX_FLAGS "-Wall") # 开启 set(CMAKE_BUILD_TYPE "Debug") set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -fPIC -O0 -Wall -g2 -ggdb") -ADD_DEFINITIONS(-DWEBRTC_LINUX -DWEBRTC_POSIX) -#add_definitions(-DABSL_STRINGS_STRING_VIEW_H_) - -AUX_SOURCE_DIRECTORY(. mixer) +ADD_DEFINITIONS(-DWEBRTC_LINUX -DWEBRTC_POSIX -DWEBRTC_APM_DEBUG_DUMP=0) + +if(NOT CMAKE_SYSTEM_NAME MATCHES Windows) + ADD_DEFINITIONS(-DWEBRTC_POSIX) +endif() + +if(CMAKE_SYSTEM_NAME MATCHES iOS) + message(==============now is iOS================) + ADD_DEFINITIONS(-DWEBRTC_IOS) + ADD_DEFINITIONS(-DWEBRTC_MAC) +elseif(CMAKE_SYSTEM_NAME MATCHES Darwin) + message(==============now is Mac================) + ADD_DEFINITIONS(-DWEBRTC_MAC) +elseif(CMAKE_SYSTEM_NAME MATCHES Windows) + message(==============now is Windows================) + ADD_DEFINITIONS(-DWEBRTC_WIN) + ADD_DEFINITIONS(-DNOMINMAX) + ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN) +elseif(CMAKE_SYSTEM_NAME MATCHES Android) + message(==============now is Android================) + ADD_DEFINITIONS(-DWEBRTC_LINUX) + ADD_DEFINITIONS(-DWEBRTC_ANDROID) +elseif(CMAKE_SYSTEM_NAME MATCHES Linux) + message(==============now is linux================) + ADD_DEFINITIONS(-DWEBRTC_LINUX) +endif() + +add_subdirectory(third_party/abseil-cpp) +add_subdirectory(api) +add_subdirectory(audio) +add_subdirectory(modules) +add_subdirectory(common_audio) +add_subdirectory(rtc_base) +add_subdirectory(system_wrappers) + +AUX_SOURCE_DIRECTORY(. +mixer) include_directories(.) include_directories(third_party/abseil-cpp) + + add_executable(unitest_mixer unitest_mixer.cc MixerImpl.cpp @@ -86,6 +149,15 @@ ${mixer} ) target_link_libraries(unitest_mixer -/home/fengmao/cowa_audio/backup_git/webrtc_mixer/libts_mixer.a +#/home/fengmao/cowa_audio/backup_git/webrtc_mixer/libts_mixer.a +absl::throw_delegate absl::strings +modules_audio_mixer +rtc_base +api +audio +modules_audio_process +system_wrappers +common_audio pthread -) \ No newline at end of file +) +