Skip to content

Commit a085d7c

Browse files
Aleksi Juvanigoddessfreya
Aleksi Juvani
authored andcommitted
Fix not linking against OpenGLES.framework for iOS (rust-windowing#1224)
1 parent b47cecd commit a085d7c

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

README.md

-4
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ The plan is that glutin tries to dynamically link-to and use wayland if possible
8181

8282
Due to an issue with how mesa and Wayland play together, all shared contexts must use the same events pool as each other.
8383

84-
### iOS
85-
86-
In order to build in XCode, you must link both `UIKit.framework` and `OpenGLES.framework`. In order for your app to not crash while attempting to obtain a context, you must also link `CoreFoundation.framework` and `GLKit.framework`.
87-
8884
## Common issues
8985

9086
Help! I'm receiving `NoAvailablePixelFormat`!

glutin_gles2_sys/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ fn main() {
1010
println!("cargo:rerun-if-changed=build.rs");
1111

1212
if target.contains("ios") {
13+
println!("cargo:rustc-link-lib=framework=GLKit");
14+
println!("cargo:rustc-link-lib=framework=OpenGLES");
1315
let mut file = File::create(&dest.join("gles2_bindings.rs")).unwrap();
1416
Registry::new(Api::Gles2, (2, 0), Profile::Core, Fallbacks::None, [])
1517
.write_bindings(gl_generator::StaticStructGenerator, &mut file)

glutin_gles2_sys/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ pub const kEAGLRenderingAPIOpenGLES1: NSUInteger = 1;
7979
pub const kEAGLRenderingAPIOpenGLES2: NSUInteger = 2;
8080
pub const kEAGLRenderingAPIOpenGLES3: NSUInteger = 3;
8181

82-
#[link(name = "UIKit", kind = "framework")]
83-
#[link(name = "CoreFoundation", kind = "framework")]
84-
#[link(name = "GlKit", kind = "framework")]
8582
extern "C" {
8683
pub static kEAGLColorFormatRGB565: id;
8784
// pub static kEAGLColorFormatRGBA8: id;

0 commit comments

Comments
 (0)