macos - 如何使用 Homebrew 软件构建带有调试符号的库?

标签 macos debugging homebrew

homebrew 是否有任何选项来构建带有调试符号的包?我使用 QT 库开发了一个应用程序,并希望从我的 IDE 中快速访问它的源代码。

我的QT安装步骤:

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

最佳答案

Homebrew 没有这样的通用选项。运行 brew info <formula>获取给定公式的可用选项。

qt的情况下没有 --debug选项:

$ 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

旁注:使用 brew --prefix <formula>获取公式的已安装前缀。如果链接,您将获得一个与版本无关的前缀:

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

这适用于公式升级,因为 Homebrew 负责更新符号链接(symbolic link)。

关于macos - 如何使用 Homebrew 软件构建带有调试符号的库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45274051/

相关文章:

javascript - 在 native javascript promise 链中利用控制台日志记录

android - 如何使用我的 Android 手机在 Linux 中调试我的应用程序?

xcode - Homebrew 找不到已安装的命令行工具

尽管包含 png.h,但 PNG 中的 c++ undefined reference

macos - 使用原生 Mac OS X 对话框为 pcap 请求权限

macos - os X 上的 mpirun

ruby-on-rails - 将 config/database.yml 的用户名更改为与您的 OSX 用户帐户相同

debugging - 诊断/确定 Web 应用程序中导致混合内容警告的最佳策略是什么?

macos - 创建右对齐的 NSView

macos - Homebrew 不会运行 wget 命令(库未加载)