From eccf0daf7f482a61ba0bf463c9b9650dbf17ab72 Mon Sep 17 00:00:00 2001 From: Rahul Raj Date: Thu, 29 Jan 2026 02:34:14 +0530 Subject: [PATCH] Enable CMAKE_MSVC_RUNTIME_LIBRARY support via CMP0091 policy This change enables users to configure the MSVC runtime library using CMAKE_MSVC_RUNTIME_LIBRARY (e.g., MultiThreaded or MultiThreadedDebug) for static linking scenarios. Without this policy set to NEW, CMAKE_MSVC_RUNTIME_LIBRARY is ignored, making it impossible to build with static runtime (/MT, /MTd) via CMake parameters alone. The conditional check ensures backward compatibility with CMake versions prior to 3.15 where CMP0091 doesn't exist. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e64573b..b09624a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,9 @@ # cmake_minimum_required(VERSION 3.4.1...3.17.2) +if(POLICY CMP0091) + cmake_policy(SET CMP0091 NEW) +endif() set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}") project(ixwebsocket LANGUAGES C CXX VERSION 11.4.6)