Skip to content

Commit d6da4f2

Browse files
author
AsmX
committed
Fix windows static library build parameter in CMakeLists.txt
1 parent 9ae5818 commit d6da4f2

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+
add_definitions (-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
81+
if (BUILD_SHARED_LIBS)
82+
message(STATUS "Build windows dynamic libs.")
83+
else()
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)