From 5c92a8b70a0349cc13a0758ef674cf817fc41381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 14 Oct 2013 15:09:00 +0200 Subject: Xcode: Dynamically choose release/debug libs based on current configuration Non-framework builds would automatically link to whatever Qt library matched the config at the time of running qmake, eg hard-coded to libQtCore_debug, while Xcode itself allowed the user to switch between release and debug configurations. We now append an Xcode settings variable to the library path, which gets resolved at build time depending on the current config in Xcode. Change-Id: I12873e38a28d9595ef3fd0ae0ad849e6744833a9 Reviewed-by: Oswald Buddenhagen Reviewed-by: Andy Shaw --- qmake/generators/mac/pbuilder_pbx.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'qmake') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index ac9e4cc71a..03887e7938 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -874,6 +874,20 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) debug_msg(1, "pbuilder: Found library (%s) via PRL %s (%s)", opt.toLatin1().constData(), lib_file.toLatin1().constData(), library.toLatin1().constData()); remove = true; + + if (project->isActiveConfig("xcode_dynamic_library_suffix")) { + QString suffixSetting = project->first("QMAKE_XCODE_LIBRARY_SUFFIX_SETTING").toQString(); + if (!suffixSetting.isEmpty()) { + QString librarySuffix = project->first("QMAKE_XCODE_LIBRARY_SUFFIX").toQString(); + suffixSetting = "$(" + suffixSetting + ")"; + if (!librarySuffix.isEmpty()) { + library = library.replace(librarySuffix, suffixSetting); + name = name.remove(librarySuffix); + } else { + library = library.replace(name, name + suffixSetting); + } + } + } } } } -- cgit v1.2.3