Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 978
hombit Avatar asked Oct 15 '25 14:10

hombit


2 Answers

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.

like image 107
bfontaine Avatar answered Oct 19 '25 01:10

bfontaine


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

like image 20
Artefacto Avatar answered Oct 19 '25 00:10

Artefacto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!