From 622f458807b923d0c47d3ba6e2d3e2e127e5ef2f Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Thu, 25 Dec 2025 13:05:02 +0300 Subject: [PATCH] - fix Opus code build - use release build in any case to speedup the things --- src/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce9e31b9..8f2a0d39 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -330,6 +330,17 @@ add_subdirectory(${L}/libsrtp) add_subdirectory(${L}/webrtc) add_subdirectory(${L}/opus) +# Suppose the subproject defines target "mylib" +if(MSVC) + target_compile_options(opus PRIVATE /O2 /DNDEBUG) + # Optional: enable whole program optimization on MSVC + # target_compile_options(mylib PRIVATE /GL) + # target_link_options(mylib PRIVATE /LTCG) +else() + target_compile_options(opus PRIVATE -O3 -DNDEBUG) +endif() + + set (LIBS_STATIC ${LIBS_STATIC} jrtplib g729_codec gsm_codec opus gsmhr_codec g722_codec srtp3 resiprocate webrtc speexdsp)