hombit
hombit

Reputation: 151

How to build library with debug symbols with homebrew?

Does homebrew have any option to build package with debug symbols? I develop an app with QT library and would like to have fast access to its source code from my IDE.

My steps of QT installing:

brew install qt
brew link --force qt
QT_V=`brew info --json=v1 qt | jsawk -n 'out(this.installed[0].version)'` \
  ln -sf /usr/local/Cellar/qt5/${QT_V}/mkspecs /usr/local/mkspecs && \
  ln -sf /usr/local/Cellar/qt5/${QT_V}/plugins /usr/local/plugins

Upvotes: 4

Views: 1887

Answers (2)

Artefacto
Artefacto

Reputation: 97835

There is now a --debug-symbols option. See https://github.com/Homebrew/brew/pull/13608

Upvotes: 1

bfontaine
bfontaine

Reputation: 19830

Homebrew doesn’t have such universal option. Run brew info <formula> to get which options are available for a given formula.

In the case of qt there’s no --debug option:

$ brew info qt
...
==> Options
--with-docs
    Build documentation
--with-examples
    Build examples
--with-mysql
    Build with mysql support
--with-postgresql
    Build with postgresql support
--with-qtwebkit
    Build with QtWebkit module
--HEAD
    Install HEAD version

Side note: use brew --prefix <formula> to get a formula’s installed prefix. You’ll get a version-independent prefix if it’s linked:

$ brew --prefix qt
/home/baptiste/.linuxbrew/opt/qt

This works across formula upgrades because Homebrew takes care of updating the symlink.

Upvotes: 1

Related Questions