Skip to content

Commit cad85f0

Browse files
authored
Merge pull request #70 from build-cpp/fix-msvc-runtime
Actually generate the set(CMAKE_MSVC_RUNTIME_LIBRARY)
2 parents d2aa15b + 53c88ce commit cad85f0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cmake_generator.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,15 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
527527
if (project.project_msvc_runtime != parser::msvc_last) {
528528
comment("Enable support for MSVC_RUNTIME_LIBRARY");
529529
cmd("cmake_policy")("SET", "CMP0091", "NEW").endl();
530+
531+
switch (project.project_msvc_runtime) {
532+
case parser::msvc_dynamic:
533+
cmd("set")("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL");
534+
break;
535+
case parser::msvc_static:
536+
cmd("set")("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreaded$<$<CONFIG:Debug>:Debug>");
537+
break;
538+
}
530539
}
531540

532541
// clang-format on

0 commit comments

Comments
 (0)