-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: Fix dual linking of gflags when CMake variable BUILD_SHARED_LIBS
is cached
#12359
Conversation
✅ Deploy Preview for meta-velox canceled.
|
4288808
to
a42a56a
Compare
I will let @assignUser review this since he was the original author. |
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.
Thanks for the improvement, a minor comment.
FetchContent_MakeAvailable(gflags) | ||
|
||
# Workaround for https://github.com/gflags/gflags/issues/277 | ||
if(DEFINED CACHED_BUILD_SHARED_LIBS AND NOT DEFINED CACHE{BUILD_SHARED_LIBS}) |
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.
Don't we want to always reset to the value in CACHED_BUILD_SHARED_LIBS
, as that being defined means we changed the original value/unset it?
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.
Would you mean to remove AND NOT DEFINED CACHE{BUILD_SHARED_LIBS}
? It's reasonable to me if so.
I was trying to consider the case that FetchContent_MakeAvailable(gflags)
internally caches BUILD_SHARED_LIBS
again. But apparently if that happens, we cannot change the cached value without FORCE
so it's anyway a no-op even jumping into line 55.
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.
Thanks, yes that's right. We should force it then. Otherwise it could leak into the main build, unlikely but can cause fun to debug issues ^^
BUILD_SHARED_LIBS
is cachedBUILD_SHARED_LIBS
is cached
BUILD_SHARED_LIBS
is cachedBUILD_SHARED_LIBS
is cached
@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@zhztheplayer Got "This diff is either too old, or sits on an old base revision, making it unsafe to land - try rebasing first." Would you rebase? |
04b32df
to
4b82b2f
Compare
Thanks, rebased. |
@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@mbasmanova merged this pull request in a034fe0. |
This fixes #12358.