build: CMake project fixes for MS Visual C++ compiler#11397
build: CMake project fixes for MS Visual C++ compiler#11397mabrarov wants to merge 11 commits intofluent:masterfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds delayed-extension CXX/link flag variables, moves MSVC runtime and /utf-8 handling into per-config delayed workflow, updates Windows builder to use Ninja/vcpkg, refines CMake flag handling across platforms, and fixes 64-bit file-mapping on Windows. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer/CI
participant Docker as Windows Builder
participant Ninja as Ninja
participant CMake as CMake
participant MSVC as MSVC Toolchain
participant Linker as Linker
Dev->>Docker: trigger Windows build
Docker->>Ninja: install & use Ninja generator
Ninja->>CMake: configure (reads FLB_EXTRA_CMAKE_CXX_* and vcpkg toolchain)
CMake->>MSVC: apply per-config flags (/utf-8, runtime selection, delayed CXX flags)
MSVC->>Linker: compile & link
Linker->>Dev: produce artifact
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0f21046 to
36badb0
Compare
36badb0 to
ae52f35
Compare
ae52f35 to
6e2e864
Compare
0e9adaf to
0da154b
Compare
|
FYI, the only remaining library linking issue with multi-config CMake generators and MSVC is LibYAML located at: Line 438 in d142e3f and Line 1082 in d142e3f There is a chance that it is the only remaining issue with multi-config CMake generators and MSVC at all. Due to LibYAML (CMake project of LibYAML) doesn't provide its layout (location and naming of built libraries) for multi-config builds - release and debug versions of LibYAML library file have same file name and are placed in the same directory - a custom FindLibYAML CMake module (e.g. to use yaml.lib for release builds and yamld.lib for debug builds with MSVC) is debatable and is not included into this PR. I plan to add it in a separate PR (refer to feature/cmake_libyaml branch) once this PR is approved and merged. |
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
Signed-off-by: Marat Abrarov <abrarov@gmail.com>
0da154b to
19534a6
Compare
Summary
Note: multi-config CMake Generators (like "Visual Studio" ones) can still have issues due to Fluent Bit CMake project doesn't honor and doesn't support the build type(s) specified when CMake generates native build system project - e.g.
CMAKE_BUILD_TYPEpassed through command line andCMAKE_CONFIGURATION_TYPES. Support of multi-config CMake Generators can require usage of CMake generator expressions everywhere build-config specific compiler / linker options are added / modified, can require revisiting of the way linked libraries are specified, e.g. they should not use-loption with hard-coded name of static library file, because the name of library file can depend on build configuration on Windows - e.g. libcrypto.lib forReleaseandRelWithDebInfobuilds with/MTcompiler option (static release MS C/C++ runtime) vs libcryptod.lib forDebugbuild with/MTdcompiler option (static debug MS C/C++ runtime).Testing
Before we can approve your change; please submit the following in a comment:
TEST_PRESET=valgrind SKIP_TESTS='flb-rt-out_td flb-it-network' ./run_code_analysis.shok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit
Build & Infrastructure
Documentation
Bug Fixes