Skip to content

Instantly share code, notes, and snippets.

@Iainmon
Last active April 10, 2019 23:03
Show Gist options
  • Save Iainmon/fab1ecabf5a8f66622e2b0ddaffa2755 to your computer and use it in GitHub Desktop.
Save Iainmon/fab1ecabf5a8f66622e2b0ddaffa2755 to your computer and use it in GitHub Desktop.
# Build executable normally
shards build --release
# See dependant libraries
otool -L bin/EXECUTABLE
# Install any the static libs that are required
brew reinstall -s libgc
brew reinstall -s libevent
# Create a project libraries folder
mkdir vendor
# Copy newly installed static libs to project vendor folder
cp /usr/local/opt/bdw-gc/lib/libgc.a vendor
cp /usr/local/opt/libevent/lib/libevent.a vendor
# OPTIONAL (COMON LIBS)
sudo cp /usr/local/opt/openssl/lib/libssl.a vendor
sudo cp /usr/local/opt/openssl/lib/libcrypto.a vendor
# ENDOPTIONAL
# Build with using static libs in the project's vendor folder
shards build --release --link-flags="-L`pwd`/vendor"
# Test again
otool -L bin/EXECUTABLE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment