From 978079fd5545e08bacb3d370c0c551cb4dddef9a Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Fri, 23 Jun 2023 11:42:10 +0300 Subject: [PATCH] - fixes for CMakeLists --- src/CMakeLists.txt | 50 ++------------------------------ src/engine/helper/CMakeLists.txt | 4 +++ src/libs/resiprocate | 2 +- 3 files changed, 7 insertions(+), 49 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8358ff59..babbc4a4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,53 +1,7 @@ project(rtphone) -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.10) -macro(configure_msvc_runtime) - if(MSVC) - # Default to statically-linked runtime. - if("${MSVC_RUNTIME}" STREQUAL "") - set(MSVC_RUNTIME "static") - endif() - # Set compiler options. - set(variables - CMAKE_C_FLAGS_DEBUG - CMAKE_C_FLAGS_MINSIZEREL - CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS_DEBUG - CMAKE_CXX_FLAGS_MINSIZEREL - CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_RELWITHDEBINFO - ) - if(${MSVC_RUNTIME} STREQUAL "static") - message(STATUS - "rtphone: MSVC -> forcing use of statically-linked runtime." - ) - foreach(variable ${variables}) - if(${variable} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}") - endif() - endforeach() - else() - message(STATUS - "rtphone: MSVC -> forcing use of dynamically-linked runtime." - ) - foreach(variable ${variables}) - if(${variable} MATCHES "/MT") - string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}") - endif() - endforeach() - endif() - - foreach(variable ${variables}) - string(REGEX REPLACE "/Z[iI7]" "" - ${variable} - "${${variable}}") - - set(${variable} "${${variable}} /Zi /Oy-") - endforeach() - endif() -endmacro() # Rely on C++ 17 @@ -225,4 +179,4 @@ target_include_directories(rtphone ) # For MSVC static builds -configure_msvc_runtime() +set_property(TARGET rtphone PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") diff --git a/src/engine/helper/CMakeLists.txt b/src/engine/helper/CMakeLists.txt index 303ff22a..7b8226c1 100644 --- a/src/engine/helper/CMakeLists.txt +++ b/src/engine/helper/CMakeLists.txt @@ -17,3 +17,7 @@ set_property(TARGET helper_lib PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$