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

Fix "'GLOG_EXPORT' macro redefined" on clang-cl #803

Merged
merged 1 commit into from
Mar 8, 2022
Merged

Conversation

drigz
Copy link
Member

@drigz drigz commented Mar 7, 2022

The previous approach used
--incompatible_enable_cc_toolchain_resolution, which is recommended by
the docs, but a Bazel developer told me it's obsolete. The new, old
approach is simpler and should stop the warning from being user-visible.

The previous approach used
--incompatible_enable_cc_toolchain_resolution, which is recommended by
the docs, but a Bazel developer told me it's obsolete. The new, old
approach is simpler and should stop the warning from being user-visible.
@drigz drigz requested a review from sergiud March 7, 2022 17:24
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2022

Codecov Report

Merging #803 (57be90e) into master (d153e29) will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #803      +/-   ##
==========================================
+ Coverage   73.13%   73.20%   +0.07%     
==========================================
  Files          17       17              
  Lines        2963     3281     +318     
==========================================
+ Hits         2167     2402     +235     
- Misses        796      879      +83     
Impacted Files Coverage Δ
src/utilities.cc 67.64% <0.00%> (-3.66%) ⬇️
src/vlog_is_on.cc 70.22% <0.00%> (-2.67%) ⬇️
src/symbolize.cc 64.11% <0.00%> (-2.55%) ⬇️
src/logging.cc 74.69% <0.00%> (-0.67%) ⬇️
src/raw_logging.cc 100.00% <0.00%> (ø)
src/signalhandler.cc 6.45% <0.00%> (+0.06%) ⬆️
src/demangle.cc 97.48% <0.00%> (+0.10%) ⬆️
src/stacktrace_unwind-inl.h 92.85% <0.00%> (+67.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d153e29...57be90e. Read the comment docs.

@sergiud
Copy link
Collaborator

sergiud commented Mar 8, 2022

I'm wondering if it is possible to split GLOG_EXPORT definitions using local_defines to avoid defining -Wno-macro-redefined?

@drigz
Copy link
Member Author

drigz commented Mar 8, 2022

Bazel doesn't appear to be smart enough to deduplicate defines and local_defines:

        local_defines = ["FOO=local"],
        defines = ["FOO=global"],

build with -s leads to:

/usr/bin/gcc [...] '-DFOO=global' [...] '-DFOO=local' [...]

@drigz drigz merged commit 5addeed into master Mar 8, 2022
@drigz drigz deleted the fix-error-on-clang branch March 8, 2022 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants