Use CMAKE_MSVC_RUNTIME_LIBRARY to select BoringSSL C runtime. (#1232)
Fixes CI on Windows.
Unsure exactly what triggered it upstream but without this, cmake
starting adding /MD to the cflags and overriding ours, causing
link errors. Switching Conscrypt to /MT causes runtime crashes.
This fix seems better than setting the flags directly anyway.
Maybe worth upstreaming as the default unless there are use cases
for CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 82f57cc..49ff88d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -140,7 +140,7 @@
& $Env:GITHUB_WORKSPACE\.github\workflows\vsenv.ps1 -arch x64 -hostArch x64
mkdir build64
pushd build64
- cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE=/MT -DCMAKE_CXX_FLAGS_RELEASE=/MT -GNinja ..
+ cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -GNinja ..
ninja
popd
diff --git a/BUILDING.md b/BUILDING.md
index 952abf4..7ac7f8e 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -110,8 +110,7 @@
cd build64
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ^
-DCMAKE_BUILD_TYPE=Release ^
- -DCMAKE_C_FLAGS_RELEASE=/MT ^
- -DCMAKE_CXX_FLAGS_RELEASE=/MT ^
+ -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded ^
-GNinja ..
ninja
```