CMakeLists.txt: add inter-library links for cmake #94
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
KittenSquad/glewlwyd!94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "target-link-libs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With these changes I'm able to check out and build, without having any
the babelouest libraries installed ahead of time.
Cmake might have a better way to pick up transitive dependencies
between external projects and order the targets based on that, but I
couldn't figure it out.
The CI scripts say there's something wrong with this patch:
The cmake script goes like this:
https://github.com/babelouest/glewlwyd/blob/master/CMakeLists.txt#L135
Look for Orcania library minimum version
ORCANIA_VERSION_REQUIRED("2.1.0" at the moment). If not found, download it on github, build and install.And so on with the other libraries.
IIRC, the dependency ordering (and perhaps the link deps) between the libraries is unknown to cmake when it's running the download codepath for many of these libraries. I'll have to look closer at why it works with travis but not on my Mac, stand by...
I can come with another solution like a new option for each libraries, if this option is set to off, don't download and install the library, just exit with error message
I still haven't gotten to the bottom of 1) why the linking works for travis (and everyone else for that matter) when the cmake
download_projectpaths are running and 2) what those error messages from cmake in travis mean. I suspect some combination of my clang/osx/cmake setup makes thesetarget_link_librariesimportant. I'll narrow it down this afternoon.I've added the cmake option
DOWNLOAD_DEPENDENCIES, if you set it tooff, it won't download the libraries if missing, just stopping with an error:github.com/babelouest/glewlwyd@d42816d4f2I finally got somewhere with this.
When linking a plugin .so on OSX, cmake/clang was spewing
Undefined symbolserrors and exiting. Eg from libprotocol_register.so, the first plugin cmake builds:This is why I added those
target_link_librariesso everything was built in the right order and no undefined symbols. (As to why those work fine on my cmake and crap out on Linux, still a mystery).I got a travis-like build container and watched it link libprotocol_register.so. It was a-ok with missing symbols. Different linker behavior, could there be an option to change it?
Googling around I found
LDFLAGS="-Wl,-undefined -Wl,dynamic_lookup"which allows bundle links with undefined symbols on my clang. Now I can do a complete compile without this PR, phew.It's not totally satisfying because there are 2x the undefined symbols when linking under darwin vs linux. Eg, gnutls is available at the time libprotocol_register.so is linked, but cmake doesn't figure that out.
I'd rather get rid of your
Undefined symbolserrors once and for all, other OSX users may encounter the same problems.Can you open an issue and post the full output of your cmake log?
Pull request closed