diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-02-15 18:15:18 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-18 15:52:36 +0100 |
commit | 9dcbfc1c44099d2d510163cf16bbb72e6ea42cae (patch) | |
tree | 489314361bf4e44f57e06af780f32090f62beffa /mkspecs/features/resolve_config.prf | |
parent | 18a65b6cdf0895e3ce8a101f8a315751297b3541 (diff) |
refactor build config resolution
the current approach of having "free-flying" prf files for such a core
issue is rather insane. this was noticed early on, as evidenced by the
forcible loading of debug/release/debug_and_release in default_post.
however, things remained a mess, in particular static vs. shared.
consequently, the commit merges all related feature files. the actual
config resolution is put in a separate feature file, so it can be loaded
by resolve_target if that happens to be loaded early on.
Change-Id: Ie30e7c63cabe9409a3263ca1650e323a870926f2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'mkspecs/features/resolve_config.prf')
-rw-r--r-- | mkspecs/features/resolve_config.prf | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/mkspecs/features/resolve_config.prf b/mkspecs/features/resolve_config.prf new file mode 100644 index 0000000000..e85435cf73 --- /dev/null +++ b/mkspecs/features/resolve_config.prf @@ -0,0 +1,51 @@ +# +# W A R N I N G +# ------------- +# +# This file is not part of the Qt API. It exists purely as an +# implementation detail. It may change from version to version +# without notice, or even be removed. +# +# We mean it. +# + +staticlib: \ + CONFIG += static +else: dll: \ + CONFIG += shared + +!shared:!static { + contains(QT_CONFIG, static): CONFIG += static + else: CONFIG += shared +} + +CONFIG(static, static|shared) { + CONFIG -= shared dll + contains(TEMPLATE, ".*lib"): CONFIG += staticlib +} else { + CONFIG -= static staticlib + contains(TEMPLATE, ".*lib"): CONFIG += dll +} + +static_and_shared { + !macx-xcode: addExclusiveBuilds(static, Static, shared, Shared) +} else: fix_output_dirs { + static: \ + fixExclusiveOutputDirs(static, shared) + else: \ + fixExclusiveOutputDirs(shared, static) +} + +CONFIG(debug, debug|release): \ + CONFIG -= release +else: \ + CONFIG -= debug + +debug_and_release { + !macx-xcode: addExclusiveBuilds(debug, Debug, release, Release) +} else: fix_output_dirs { + debug: \ + fixExclusiveOutputDirs(debug, release) + else: \ + fixExclusiveOutputDirs(release, debug) +} |