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

fixed windows builds #639

Merged
merged 1 commit into from
Apr 9, 2021
Merged

fixed windows builds #639

merged 1 commit into from
Apr 9, 2021

Conversation

sergiud
Copy link
Collaborator

@sergiud sergiud commented Apr 8, 2021

No description provided.

@sergiud sergiud added the bug label Apr 8, 2021
@sergiud sergiud added this to the 0.5 milestone Apr 8, 2021
@sergiud sergiud self-assigned this Apr 8, 2021
@google-cla google-cla bot added the cla: yes label Apr 8, 2021
bazel/glog.bzl Show resolved Hide resolved
@@ -93,13 +93,13 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
]

windows_only_copts = [
"-DGLOG_NO_ABBREVIATED_SEVERITIES",
Copy link
Member

Choose a reason for hiding this comment

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

This seems like it could break users. Can you add a #define to port.h instead, along the lines of the docs? https://github.com/google/glog#notes-for-windows-users

Copy link
Member

Choose a reason for hiding this comment

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

On second thoughts, as it's in copts rather than defines, it's unlike to affect users but it would still be cleaner to use the approach in the docs IMO.

Copy link
Collaborator Author

@sergiud sergiud Apr 8, 2021

Choose a reason for hiding this comment

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

Are you saying that the define is transitive, i.e., it is forwarded to library's consumer? Either way, CMake always defines GLOG_NO_ABBREVIATED_SEVERITIES on Windows to avoid conflicts due to ERROR:

glog/CMakeLists.txt

Lines 598 to 600 in a79416b

if (WIN32)
target_compile_definitions (glog PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES)
endif (WIN32)

If I recall correctly, on Windows glog without GLOG_NO_ABBREVIATED_SEVERITIES is unusable anyway once windows.h is included (which is in many cases true). Regardless, we should probably sync the approach taken by both build systems.

Copy link
Member

Choose a reason for hiding this comment

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

defines are transitive (useful when needed in public headers) but copts are not. If CMake does it too then this LGTM, thanks!

@sergiud sergiud linked an issue Apr 8, 2021 that may be closed by this pull request
@sergiud sergiud linked an issue Apr 8, 2021 that may be closed by this pull request
@sergiud sergiud merged commit 7ec73b5 into google:master Apr 9, 2021
@sergiud sergiud deleted the fix-windows-builds branch April 9, 2021 08:24
@sergiud sergiud mentioned this pull request May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

call InitGoogleLogging get a segment fault glog mingw32 compilation fails on Windows!
2 participants