Skip to content
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

[Cherry Pick] build:Extend Common Compile Settings to Protobuf #124

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

fpetrini15
Copy link
Contributor

Goal: Fix the Windows build which was failing to compile c++17 features due the GRPC repo bump in our third party repo.

@fpetrini15 fpetrini15 changed the title [Cherry Pick] Extend Common Compile Settings to Protobuf [Cherry Pick] build:Extend Common Compile Settings to Protobuf Jul 11, 2024
@fpetrini15 fpetrini15 requested a review from mc-nv July 12, 2024 00:07
proto-library PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wextra -Wno-unused-parameter -Werror>
$<$<CXX_COMPILER_ID:MSVC>:/W0 /D_WIN32_WINNT=0x0A00 /EHsc /Zc:preprocessor>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These options are responsible for:

/W0 - provide all warnings
/D_WIN32_WINNT=0x0A00 - defines version of Windows that binary compiled for.
/EHsc - specific flag to manage exceptions
/Zc:preprocessor - conformance flag for C++ language standards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe /W0 suppresses all warnings.

target_compile_options(
proto-library PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -Wextra -Wno-unused-parameter -Werror>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This options are responsible for:
-Wall - enable all warnings
-Wextra - enable extra warnings
-Wno-unused-parameter - can't find definition
-Werror - make all warnings as error

@mc-nv mc-nv requested review from tanmayv25 and nnshah1 and removed request for nnshah1 July 12, 2024 03:01
@fpetrini15 fpetrini15 merged commit 54ce011 into r24.07 Jul 12, 2024
2 checks passed
@fpetrini15 fpetrini15 deleted the fpetrini-win-compile-fix-cherry-pick branch July 12, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants