benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Windows: support static CRT runtime in CMakeLists.txt

Open KindDragon opened this issue 8 years ago • 2 comments

Something like that https://github.com/grpc/grpc/blob/master/cmake/msvc_static_runtime.cmake

KindDragon avatar May 10 '17 20:05 KindDragon

Can someone explain the potential benefit? I'm finding it hard to have an opinion without understanding what problem this solves.

dmah42 avatar Apr 27 '21 12:04 dmah42

The MSVC static/dynamic CRT's aren't compatible so the project being benchmarked is linked with the MSVC static CRT you get a linker error since benchmark.lib is linked with the MSVC dynamic CRT (which is the default).

But no support needs to be added, passing -DCMAKE_CXX_FLAGS_RELEASE=/MT when building the benchmark library will link benchmark.lib with the static CRT.

scott-ferguson-unity avatar Apr 22 '22 15:04 scott-ferguson-unity