-
Notifications
You must be signed in to change notification settings - Fork 1.9k
build: CMake project fixes for MS Visual C++ compiler #11397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds delayed-extension variables for C++ compile/link flags and applies them when C++ is enabled; adjusts MSVC runtime handling and enables UTF‑8; switches Windows CI/build to Ninja and updates Windows build invocation in the developer guide. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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
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>
5dff124 to
7f8fdee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@CMakeLists.txt`:
- Around line 57-63: The unconditional set of FLB_EXTRA_CMAKE_CXX_FLAGS and
FLB_EXTRA_CMAKE_CXX_LINK_FLAGS is shadowing command-line -D overrides; change
the initialization so caller-provided values are preserved by either (a)
wrapping the current set calls with if(NOT DEFINED FLB_EXTRA_CMAKE_CXX_FLAGS) /
if(NOT DEFINED FLB_EXTRA_CMAKE_CXX_LINK_FLAGS) or (b) declare them as cache
variables (e.g., set(FLB_EXTRA_CMAKE_CXX_FLAGS "" CACHE STRING "extra CXX
flags") and set(FLB_EXTRA_CMAKE_CXX_LINK_FLAGS "" CACHE STRING "extra CXX link
flags")) so later appends (e.g., where FLB_EXTRA_CMAKE_CXX_LINK_FLAGS is
extended with -latomic) will honor -D overrides; update the existing set(...)
lines around FLB_EXTRA_CMAKE_CXX_FLAGS and FLB_EXTRA_CMAKE_CXX_LINK_FLAGS
accordingly.
In `@dockerfiles/Dockerfile.windows`:
- Around line 86-104: The RUN block that downloads Ninja (variables
NINJA_VERSION, NINJA_URL, NINJA_HOME and local vars $ninja_dist_name,
$ninja_dist, $ninja_download_url) lacks SHA256 validation; after
Invoke-WebRequest and before Expand-Archive compute the SHA256 of ${ninja_dist}
with Get-FileHash -Algorithm SHA256 and compare it against the known digest
07fc8261b42b20e71d1720b39068c2e14ffcee6396b76fb7a795fb460b78dc65, and if they
differ throw an error/exit the build (e.g. throw or [Environment]::Exit(1)) to
prevent extraction; keep the rest of the flow (Remove-Item, Expand-Archive, PATH
and SetEnvironmentVariable) unchanged.
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
✏️ Tip: You can customize this high-level summary in your review settings.