Skip to content

Instantly share code, notes, and snippets.

@vojd
Created October 28, 2018 14:20
Show Gist options
  • Save vojd/87b5c8554b44ea1fd17d71b36665d747 to your computer and use it in GitHub Desktop.
Save vojd/87b5c8554b44ea1fd17d71b36665d747 to your computer and use it in GitHub Desktop.
GLFW Building .dylib for MacOS Mojave 10.14
# Fetch GLFW
wget https://github.com/glfw/glfw/archive/master.zip
unzip master
cd glfw-master/
# Configure build
export MACOSX_DEPLOYMENT_TARGET=10.14
cmake -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="x86_64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang .
# Build
make
# Install to system wide locations
make install
# Verify
ls /usr/local/lib/libglfw*
=>
libglfw.3.3.dylib*
libglfw.3.dylib@ -> libglfw.3.3.dylib
libglfw.3.dylib
# When linking GLFW in XCODE remember two things:
# 1: Under your target, Build Phases:
# => Link Binary with Libraries: add your newly created .dylib
# 2: Under your Project, Build Settings:
# => Add path to where GLFW3 lib was installed: /usr/local/lib/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment