Skip to content

Commit 4380d9a

Browse files
committed
Merge pull request #1182 from MiyamuraMiyako/master
Fix windows static library build parameter in CMakeLists.txt
1 parent 204198f commit 4380d9a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ cpr_option(CPR_DEBUG_SANITIZER_FLAG_UB "Enables the UndefinedBehaviorSanitizer f
7676
cpr_option(CPR_DEBUG_SANITIZER_FLAG_ALL "Enables all sanitizers for debug builds except the ThreadSanitizer since it is incompatible with the other sanitizers." OFF)
7777
message(STATUS "=======================================================")
7878

79+
if (MSVC)
80+
if (BUILD_SHARED_LIBS)
81+
message(STATUS "Build windows dynamic libs.")
82+
else()
83+
# Add this to build windows pure static library.
84+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
85+
message(STATUS "Build windows static libs.")
86+
endif()
87+
endif()
88+
7989
# Save the project version as txt file for deb and NuGet builds
8090
if(CPR_BUILD_VERSION_OUTPUT_ONLY)
8191
message(STATUS "Printing version and exiting...")

0 commit comments

Comments
 (0)