How to build FAST with Visual Studio 2019+CMake+Ninja on Windows#755
Conversation
…-cpp into maxgolov/winbuild_with_ninja
Clean-up a few typos
add "Edition" word
Fix wording
Codecov Report
@@ Coverage Diff @@
## main #755 +/- ##
==========================================
- Coverage 95.97% 95.95% -0.02%
==========================================
Files 176 176
Lines 7172 7172
==========================================
- Hits 6883 6882 -1
- Misses 289 290 +1
|
Reword the last sentence
| if(BUILD_TESTING) | ||
| if(MSVC) | ||
| # GTest bug: https://github.com/google/googletest/issues/860 | ||
| add_compile_options(/wd4275) |
There was a problem hiding this comment.
Could we scope this option to only test code compilation?
There was a problem hiding this comment.
Unfortunately the issue is that we have so many different test projects, and it appears like it would have to be applied to all projects that use Google Test. The warning comes from Google Test header. I wonder if there is a trick that can be used to selectively add compile options if target name matches *test*, but it may not be sufficient.
The root cause fix is in the latest Google Test. But that latest Google Test is not yet getting pulled via vcpkg, so I see this error. It'd have to be added to too many files, pretty much to all test project files. I can do that if you insist.
My logical reasoning here as follows:
- warning is related to DLL exports and is only seen in Google Test.
- we know our own interfaces are all fine. Only Google Test header has the issue, not the SDK itself.
- and we do not support publishing the SDK as DLL yet in v1.0, not at least until v1.1 of SDK.
So suppressing this DLL export warning globally does not anyhow regress any of our other code.
Change optimization flag name to MSVC_CXX_OPT_FLAG
…-cpp into maxgolov/winbuild_with_ninja
…-telemetry/opentelemetry-cpp into maxgolov/winbuild_with_ninja
Changes
This is a set of changes + documentation needed to switch from
MSBuildtoNinjafor Windows build.What it gives:
This is rather trivial change. No code changes. Just build infra. See
building-with-vs2019.mdmarkdown for all the details.I'll send a separate follow-up PR that adds this process (
setup-buildtools.cmd+build.cmd) as part of our CI/CD loop, with a goal in mind to continuously validate bothnostdandstdlibbuild flavor on Windows. This process is flexible, as it supports any Visual Studio version and any compiler. In fact, it even works with CLang-LLVM if Visual Studio is not installed (verified that). I have not tested if similar process works for MinGW or Emscripten. But from previous personal experience, same build script should largely work with minor adjustments for other compilers. Linux process doc comes after in a separate PR.