cginternals / cginternals/glbinding

Linker issue in Homebrew distribution

Open
#244 1 comment 0 reactions 0 assignees View on GitHub
bug Setup
Dominant language
C++
Stars
877
Forks
95
PR merge metrics
No merged PRs in 30d

Description

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 `/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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.