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

Linker issue in Homebrew distribution #244

Open
pyrrho opened this issue Nov 9, 2017 · 1 comment
Open

Linker issue in Homebrew distribution #244

pyrrho opened this issue Nov 9, 2017 · 1 comment

Comments

@pyrrho
Copy link

pyrrho commented Nov 9, 2017

tl;dr -- v2.1.3 distributed via homebrew is attempting to link against the OpenGL Framework bundle provided in Xcode's MacOSX10.12.sdk, which is not guaranteed to exist.

Specifically, the file <prefix>/glbinding/2.1.3/cmake/glbinding/glbinding-export.cmake line 59 is calling set_target_properties with

INTERFACE_LINK_LIBRARIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework"

On my system (details below) the MacOSX10.12.sdk directory doesn't exist. Including glbinding in my own project via a glbinding_DIR + find_package(glbinding REQUIRED) combination actually resulted in Ninja believing that the OpenGL.Framework was a build target that it couldn't produce.

My Xcode does provide a MacOSX10.13.sdk which does contain an OpenGL Framework, but I'm not sure that's what should be targeted. When building from source, glbinding-export.cmake targets /System/Library/Frameworks/OpenGL.framework for linking, rather than anything provided by Xcode.

I'm no CMake expert, but my understanding is that these paths are being generated by the find_package(OpenGL REQUIRED) call in source/glbinding/CMakeLists.txt. I have no insight into when that call would result in different paths being returned, so I can't offer any suggestions for resolving the mismatch. I also don't know if the Xcode and System OpenGL.Framework bundles differ, so I'm not sure if there should be a preference for one bundle over the other.

As a final confounding note, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk (and presumably MacOSX10.12.sdk for systems that have it) is actually a symlink that points to an un-versioned MacOSX.sdk that lives in the same directory. I'm not sure what to do with that information, but it seemed relevant to this discussion.

system details

macOS Sierra 10.12.6 (16G1036)

Xcode Version 9.1 (9B55)

cmake version 3.9.5

Homebrew 1.3.6

@scheibel
Copy link
Member

Thanks for reporting.
The file <prefix>/glbinding/2.1.3/cmake/glbinding/glbinding-export.cmake you reference is generated during CMake execution time. The location of the OpenGL framework is detected by searching the machine the scripts are executed on.
I suggest Homebrew has an issue when packaging glbinding for macOS versions where another version of the OpenGL framework are used. Are there details on the machines that build the bottles?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants