Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Conversation

@sergiud
Copy link
Contributor

@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
@sergiud sergiud force-pushed the fix-windows-builds branch from af30126 to 9b0e2fb Compare April 8, 2021 14:06
@sergiud sergiud force-pushed the fix-windows-builds branch from 11ef913 to efc341d Compare April 8, 2021 16:17
@sergiud sergiud requested a review from drigz April 8, 2021 16:17
]

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
Contributor 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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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