I want to build two versions of my program, a "normal" version, and one in which the address sanitizer has been activated. As of now, I have this in my QSoas.pro
sanitizer {
message("Activating the address sanitizer code")
OBJECTS_DIR = build-snt
QMAKE_CXXFLAGS += -fno-omit-frame-pointer -fsanitize=address
LIBS += -fsanitize=address
TARGET = $$join(TARGET,,,-snt)
}
This way, I can do:
~ qmake
~ make
to get the normal version, and
~ qmake CONFIG+=sanitizer
~ make
to get the version with the address sanitizer.
This is fine, but a little cumbersome, especially since I need in fact many other configuration options on the qmake
command-line. Is there a way to have two targets, so that I could simply run
~ qmake
~ make
~ make my-sanitized-exe