From 53c88ceafaa082a39f0c4b6174c29fd798964db5 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sat, 8 Oct 2022 10:37:27 +0200 Subject: [PATCH] Actually generate the set(CMAKE_MSVC_RUNTIME_LIBRARY) Closes #69 (nice) --- src/cmake_generator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cmake_generator.cpp b/src/cmake_generator.cpp index ff1893c..3ca28e3 100644 --- a/src/cmake_generator.cpp +++ b/src/cmake_generator.cpp @@ -527,6 +527,15 @@ void generate_cmake(const char *path, const parser::Project *parent_project) { if (project.project_msvc_runtime != parser::msvc_last) { comment("Enable support for MSVC_RUNTIME_LIBRARY"); cmd("cmake_policy")("SET", "CMP0091", "NEW").endl(); + + switch (project.project_msvc_runtime) { + case parser::msvc_dynamic: + cmd("set")("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreaded$<$:Debug>DLL"); + break; + case parser::msvc_static: + cmd("set")("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreaded$<$:Debug>"); + break; + } } // clang-format on