简体   繁体   中英

Build Qt application on MacOS with debug symbols

How could I build an application for macOS written using Qt framework in Release mode with debug symbols information ?

I have tried what is suggested in Qt Doc:

# debug symbols
QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_OBJECTIVE_CFLAGS_RELEASE += $$QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE += $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO

But I get same output when I run nm command.

What am I missing?

Thanks in advance

You can use built-in CONFIG flags to create separate debugging symbols:

CONFIG+=force_debug_info CONFIG+=separate_debug_info

(possibly add CONFIG+=release CONFIG-=debug CONFIG-=debug_and_release to make extra-sure to get a pure release + debug info build).

Note that this is what the “Profile” build in Qt Creator does by default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM