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

Use libunwind as an imported target #368

Merged
merged 4 commits into from
Nov 10, 2019
Merged

Conversation

UVV-gh
Copy link
Contributor

@UVV-gh UVV-gh commented Oct 8, 2018

When UNWIND_LIBRARY is used directly as a public dependency then
absolute path is stored in cmake config file. This is an issue when
glog is used as part of an SDK, which was built somewhere else. When
SDK is installed on developer's machine, cmake config contains a full
path to non-existent location. The solution is to find libunwind
during configure stage and store target name as a dependency, not a full path

@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

Copy link
Collaborator

@sergiud sergiud left a comment

Choose a reason for hiding this comment

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

Please sign the CLA first.

Second, please avoid code duplication. The code should be put into a find module which is installed along glog under <prefix>/share/glog/cmake. The package config would then use find_dependency to correctly locate libunwind.

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@UVV-gh
Copy link
Contributor Author

UVV-gh commented Oct 9, 2018

@sergiud Thanks for the review. Could you please take a look if it looks better now?

@UVV-gh
Copy link
Contributor Author

UVV-gh commented Oct 19, 2018

I figured there's still room for improvement here. For example, libunwind is not found in cross-compilation environment. Please hold off for a while

@UVV-gh
Copy link
Contributor Author

UVV-gh commented Nov 2, 2018

Updated. Please take a look again

@UVV-gh
Copy link
Contributor Author

UVV-gh commented Dec 11, 2018

@sergiud I was wondering if you have any other comments/suggestions on this..

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
cmake/FindLibunwind.cmake Outdated Show resolved Hide resolved
glog-config.cmake.in Outdated Show resolved Hide resolved
cmake/FindLibunwind.cmake Outdated Show resolved Hide resolved
@googlebot googlebot removed the cla: yes label Nov 1, 2019
@google google deleted a comment from googlebot Nov 1, 2019
@googlebot
Copy link
Collaborator

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@sergiud
Copy link
Collaborator

sergiud commented Nov 2, 2019

@googlebot I consent.

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Nov 2, 2019
When UNWIND_LIBRARY is used directly as a public dependency then
absolute path is stored in cmake config file. This is an issue when
glog is used as part of an SDK, which was built somewhere else. When
SDK is installed on developer's machine, cmake config contains a full
path to non-existent location. The solution is to find libunwind
during configure stage and store target name as a dependency, not a full path.
Cmake module looks for libunwind and libunwind-PLAT, where PLAT is one of
supported platforms.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
@sergiud sergiud force-pushed the cmake-sdk-fix branch 5 times, most recently from 683547e to 7df323d Compare November 2, 2019 11:39
@sergiud sergiud force-pushed the cmake-sdk-fix branch 6 times, most recently from 1ad7317 to 41d80a9 Compare November 10, 2019 14:30
@sergiud sergiud merged commit 1863b42 into google:master Nov 10, 2019
@sergiud sergiud added this to the 0.5 milestone Apr 13, 2021
@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.

3 participants