2016-02-11 12:30:53 +00:00
|
|
|
|
2011-11-24 07:01:08 +00:00
|
|
|
defineReplace(qtPlatformTargetSuffix) {
|
Remove simulator_and_device handling for the Makefile generator
This patch moves towards a more sensible layout for UIKit platforms,
where both the device and simulator architectures for binaries are
combined into a single Mach-O file instead of separating out the
simulator architecutures into separate _simulator.a files.
This approach is both more common in the iOS ecosystem at large and
significantly simplifies the implementation details for Qt, especially
with the upcoming support for shared libraries on UIKit platforms.
This patch takes advantage of the -Xarch compiler option to pass the
appropriate -isysroot, -syslibroot, and -m*-version-min compiler and
linker flags to the clang frontend, operating in exactly the same way
as a normal multi-arch build for device or simulator did previously.
Exclusive builds are still enabled for the xcodebuild wrapper Makefile,
which builds all four configurations of a UIKit Xcode project as before,
as expected.
A particularly advantageous benefit of this change is that it flows very
well with existing Xcode workflows, namely that:
- Slicing out unused architectures is handled completely automatically
for static builds, as an executable linking to a library with more
architectures than it itself is linked as, the unused architectures
will be ignored silently, resulting in the same behavior for users
(and the App Store won't let you submit Intel architectures either).
- Removing architectures from a fat binary using lipo does NOT
invalidate the code signature of that file or its container if it is a
bundle. This allows shared library and framework builds of Qt to work
mostly automatically as well, since an Xcode shell script build phase
can remove unused architectures from the embedded frameworks when that
is implemented, and if Qt ever starts signing its SDK releases, it
won't interfere with that either (though binaries are just resigned).
Change-Id: I6c3578c78f75845a2fcc85f3a5b728ec997dbe90
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-25 13:07:54 +00:00
|
|
|
suffix =
|
2019-08-01 05:56:59 +00:00
|
|
|
android: return($${suffix}_$${QT_ARCH})
|
2020-01-13 11:11:11 +00:00
|
|
|
win32 {
|
|
|
|
CONFIG(debug, debug|release) {
|
|
|
|
mingw {
|
|
|
|
qtConfig(debug_and_release):build_pass: \
|
|
|
|
return($${suffix}d)
|
|
|
|
} else {
|
|
|
|
!debug_and_release|build_pass: \
|
|
|
|
return($${suffix}d)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-23 09:01:14 +00:00
|
|
|
darwin {
|
2020-01-13 11:11:11 +00:00
|
|
|
CONFIG(debug, debug|release) {
|
|
|
|
!debug_and_release|build_pass: \
|
|
|
|
return($${suffix}_debug)
|
2011-11-24 07:01:08 +00:00
|
|
|
}
|
|
|
|
}
|
2013-10-25 15:20:05 +00:00
|
|
|
return($$suffix)
|
2011-11-24 07:01:08 +00:00
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
defineReplace(qtLibraryTarget) {
|
|
|
|
LIBRARY_NAME = $$1
|
2016-08-05 11:35:39 +00:00
|
|
|
CONFIG(shared, static|shared):qtConfig(framework) {
|
2011-04-27 10:05:43 +00:00
|
|
|
QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
|
|
|
|
export(QMAKE_FRAMEWORK_BUNDLE_NAME)
|
|
|
|
}
|
2013-02-18 12:53:46 +00:00
|
|
|
return($$LIBRARY_NAME$$qtPlatformTargetSuffix())
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2015-02-25 15:00:58 +00:00
|
|
|
defineReplace(qt5LibraryTarget) {
|
2019-09-17 06:56:14 +00:00
|
|
|
android {
|
|
|
|
LIBRARY_NAME_PREFIX = $$2
|
|
|
|
LIBRARY_NAME_PREFIX = $$replace(LIBRARY_NAME_PREFIX, "//", "/")
|
|
|
|
LIBRARY_NAME_PREFIX = $$replace(LIBRARY_NAME_PREFIX, "/", "_")
|
|
|
|
LIBRARY_NAME = $$LIBRARY_NAME_PREFIX$$qtLibraryTarget($$1)
|
|
|
|
unset(LIBRARY_NAME_PREFIX)
|
|
|
|
} else: LIBRARY_NAME = $$qtLibraryTarget($$1)
|
2015-02-25 15:00:58 +00:00
|
|
|
isEmpty(QMAKE_FRAMEWORK_BUNDLE_NAME) {
|
|
|
|
# Insert the major version of Qt in the library name
|
|
|
|
# unless it's a framework build.
|
|
|
|
LIBRARY_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
|
|
|
|
}
|
|
|
|
return($$LIBRARY_NAME)
|
|
|
|
}
|
|
|
|
|
2016-03-09 16:42:29 +00:00
|
|
|
defineReplace(qtRelativeRPathBase) {
|
|
|
|
darwin {
|
|
|
|
if(equals(TEMPLATE, app):app_bundle)|\
|
|
|
|
if(equals(TEMPLATE, lib):plugin:plugin_bundle) {
|
2016-02-16 06:29:01 +00:00
|
|
|
shallow_bundle: return($$target.path/$${TARGET}.app)
|
2016-03-09 16:42:29 +00:00
|
|
|
return($$target.path/$${TARGET}.app/Contents/MacOS)
|
|
|
|
}
|
2016-02-16 06:29:01 +00:00
|
|
|
equals(TEMPLATE, lib):!plugin:lib_bundle {
|
|
|
|
shallow_bundle: return($$target.path/$${TARGET}.framework)
|
2016-03-09 16:42:29 +00:00
|
|
|
return($$target.path/$${TARGET}.framework/Versions/Current)
|
2016-02-16 06:29:01 +00:00
|
|
|
}
|
2016-03-09 16:42:29 +00:00
|
|
|
}
|
|
|
|
return($$target.path)
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
defineTest(qtAddLibrary) {
|
2013-10-21 14:43:43 +00:00
|
|
|
warning("qtAddLibrary() is deprecated. Use QT+= instead.")
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-03-01 17:49:29 +00:00
|
|
|
# Reverse-engineer the module name from the library name.
|
2013-06-17 10:18:36 +00:00
|
|
|
for(var, QT_MODULES) {
|
|
|
|
isEqual(QT.$${var}.name, $$1) {
|
2015-06-04 18:47:40 +00:00
|
|
|
QT += $$var
|
|
|
|
export(QT)
|
2013-10-21 14:45:15 +00:00
|
|
|
return(true)
|
2012-03-01 17:49:29 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2012-03-01 17:49:29 +00:00
|
|
|
error("No module matching library '$$1' found.")
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2012-12-21 11:09:56 +00:00
|
|
|
# qt module
|
|
|
|
defineTest(qtHaveModule) {
|
2013-10-25 10:24:20 +00:00
|
|
|
!isEmpty(QT.$$replace(1, -, _).name): \
|
2012-12-21 11:09:56 +00:00
|
|
|
return(true)
|
|
|
|
return(false)
|
|
|
|
}
|
|
|
|
|
2021-01-25 10:12:37 +00:00
|
|
|
# Arguments:
|
|
|
|
# variable, default, [suffix for variable for system() use],
|
|
|
|
# [prepare primary variable for system() use],
|
|
|
|
# [installation location; default: $$[QT_HOST_BINS]]
|
2011-04-27 10:05:43 +00:00
|
|
|
defineTest(qtPrepareTool) {
|
2014-05-21 13:14:45 +00:00
|
|
|
cmd = $$eval(QT_TOOL.$${2}.binary)
|
|
|
|
isEmpty(cmd) {
|
2021-01-25 10:12:37 +00:00
|
|
|
isEmpty(5) {
|
|
|
|
instloc = $$[QT_HOST_BINS]
|
|
|
|
} else {
|
|
|
|
instloc = $$5
|
|
|
|
}
|
|
|
|
cmd = $$instloc/$$2
|
2014-05-21 13:14:45 +00:00
|
|
|
exists($${cmd}.pl) {
|
2016-04-05 16:19:47 +00:00
|
|
|
$${1}_EXE = $${cmd}.pl
|
2014-05-21 13:14:45 +00:00
|
|
|
cmd = perl -w $$system_path($${cmd}.pl)
|
2013-05-10 16:54:41 +00:00
|
|
|
} else: contains(QMAKE_HOST.os, Windows) {
|
2016-04-05 16:19:47 +00:00
|
|
|
$${1}_EXE = $${cmd}.exe
|
2014-05-21 13:14:45 +00:00
|
|
|
cmd = $$system_path($${cmd}.exe)
|
2012-07-03 17:26:36 +00:00
|
|
|
} else:contains(QMAKE_HOST.os, Darwin) {
|
2014-05-21 13:14:45 +00:00
|
|
|
BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
|
2012-07-03 17:26:36 +00:00
|
|
|
exists($$BUNDLENAME) {
|
2014-05-21 13:14:45 +00:00
|
|
|
cmd = $$BUNDLENAME
|
2012-07-03 17:26:36 +00:00
|
|
|
}
|
2016-04-05 16:19:47 +00:00
|
|
|
$${1}_EXE = $$cmd
|
|
|
|
} else {
|
|
|
|
$${1}_EXE = $$cmd
|
2012-07-03 17:26:36 +00:00
|
|
|
}
|
2016-04-05 16:19:47 +00:00
|
|
|
} else {
|
|
|
|
$${1}_EXE = $$last(cmd)
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2016-04-05 16:19:47 +00:00
|
|
|
export($${1}_EXE)
|
2013-08-26 14:13:54 +00:00
|
|
|
QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars)
|
2015-11-23 13:14:46 +00:00
|
|
|
QT_TOOL_NAME = $$2
|
2014-09-15 15:30:42 +00:00
|
|
|
!isEmpty(3)|!isEmpty(4) {
|
2014-05-21 13:14:45 +00:00
|
|
|
$$1$$3 =
|
|
|
|
for (arg, cmd): \
|
|
|
|
$$1$$3 += $$system_quote($$arg)
|
2013-06-13 16:12:07 +00:00
|
|
|
qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system)
|
|
|
|
}
|
2014-09-15 15:30:42 +00:00
|
|
|
isEmpty(4) {
|
|
|
|
$$1 =
|
|
|
|
for (arg, cmd): \
|
|
|
|
$$1 += $$shell_quote($$arg)
|
|
|
|
qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, )
|
|
|
|
}
|
2012-09-13 16:13:13 +00:00
|
|
|
}
|
|
|
|
|
2021-01-25 10:12:37 +00:00
|
|
|
# Prepare a tool that's not supposed to be called manually by users but by the build system.
|
|
|
|
#
|
|
|
|
# Forwards its arguments to qtPrepareTool but defaults the installation location to
|
|
|
|
# $$[QT_HOST_LIBEXECS]
|
|
|
|
defineTest(qtPrepareLibExecTool) {
|
|
|
|
isEmpty(instloc): instloc = "$$[QT_HOST_LIBEXECS]"
|
|
|
|
qtPrepareTool($$1, $$2, $$3, $$4, $$instloc)
|
|
|
|
}
|
|
|
|
|
2013-06-13 16:12:07 +00:00
|
|
|
# target variable, list of env var names, [non-empty: prepare for system(), not make]
|
2012-09-13 16:13:13 +00:00
|
|
|
defineTest(qtAddToolEnv) {
|
2013-06-13 16:12:07 +00:00
|
|
|
isEmpty(3): \
|
|
|
|
ds = $$QMAKE_DIR_SEP
|
|
|
|
else: \
|
|
|
|
ds = $$DIR_SEPARATOR
|
2015-11-23 13:14:46 +00:00
|
|
|
batch_sets =
|
2012-09-13 16:13:13 +00:00
|
|
|
for(env, 2) {
|
|
|
|
value = $$eval($${env}.value)
|
|
|
|
!isEmpty(value) {
|
|
|
|
name = $$eval($${env}.name)
|
2015-12-11 13:14:13 +00:00
|
|
|
config = $$eval($${env}.CONFIG)
|
2013-06-13 16:12:07 +00:00
|
|
|
equals(ds, /) {
|
2015-12-11 13:14:13 +00:00
|
|
|
contains(config, prepend): infix = \${$$name:+:\$$$name}
|
|
|
|
else: contains(config, always_prepend): infix = :\$$$name
|
2012-09-13 16:13:13 +00:00
|
|
|
else: infix =
|
2015-11-23 13:14:46 +00:00
|
|
|
# Under msys, this path is taken only in the non-system()
|
|
|
|
# case, so using shell_quote() always works.
|
|
|
|
batch_sets += \
|
|
|
|
"$$name=$$shell_quote($$join(value, :))$$infix" \
|
|
|
|
"export $$name"
|
2012-09-13 16:13:13 +00:00
|
|
|
} else {
|
2015-11-23 13:14:46 +00:00
|
|
|
value ~= s,\\^,^^^^,g
|
|
|
|
value ~= s,!,^^!,g
|
2014-11-19 13:55:13 +00:00
|
|
|
value ~= s,\\),^),g
|
2015-12-11 13:14:13 +00:00
|
|
|
contains(config, prepend) {
|
2015-11-23 13:14:46 +00:00
|
|
|
batch_sets += \
|
|
|
|
"if defined $$name (" \
|
|
|
|
" set $$name=$$join(value, ;);!$$name!" \
|
|
|
|
") else (" \
|
|
|
|
" set $$name=$$join(value, ;)" \
|
|
|
|
")"
|
2015-12-11 13:14:13 +00:00
|
|
|
} else: contains(config, always_prepend) {
|
|
|
|
batch_sets += "(set $$name=$$join(value, ;);!$$name!)"
|
2015-11-23 13:14:46 +00:00
|
|
|
} else {
|
|
|
|
batch_sets += "(set $$name=$$join(value, ;))"
|
|
|
|
}
|
2013-06-13 15:37:53 +00:00
|
|
|
}
|
2012-09-13 16:13:13 +00:00
|
|
|
}
|
|
|
|
}
|
2015-11-23 13:14:46 +00:00
|
|
|
!isEmpty(batch_sets) {
|
|
|
|
batch_name = wrapper
|
|
|
|
!isEmpty(QT_TOOL_NAME): batch_name = $${QT_TOOL_NAME}_wrapper
|
|
|
|
cmd = $$eval($$1)
|
|
|
|
!isEmpty(cmd): cmd = "$$cmd "
|
|
|
|
equals(ds, /) {
|
|
|
|
batch_name = $${batch_name}.sh
|
2019-10-08 13:24:53 +00:00
|
|
|
equals(QMAKE_HOST.os, Darwin):exists(/bin/bash): \
|
|
|
|
shell = /bin/bash
|
|
|
|
else: \
|
|
|
|
shell = /bin/sh
|
2015-11-23 13:14:46 +00:00
|
|
|
batch_cont = \
|
2019-10-08 13:24:53 +00:00
|
|
|
"$$LITERAL_HASH!$$shell" \
|
2015-11-23 13:14:46 +00:00
|
|
|
$$batch_sets \
|
|
|
|
"exec $$cmd\"$@\""
|
|
|
|
# It would be nicer to use the '.' command (without 'exec' above),
|
|
|
|
# but that doesn't set the positional arguments under (d)ash.
|
|
|
|
$$1 =
|
|
|
|
} else {
|
|
|
|
batch_name = $${batch_name}.bat
|
|
|
|
batch_cont = \
|
|
|
|
"@echo off" \
|
|
|
|
"SetLocal EnableDelayedExpansion" \
|
|
|
|
$$batch_sets \
|
|
|
|
"$$cmd%*" \
|
|
|
|
"EndLocal"
|
|
|
|
$$1 = call
|
|
|
|
}
|
2016-07-14 14:50:02 +00:00
|
|
|
!build_pass:!write_file($$OUT_PWD/$$batch_name, batch_cont, exe): error()
|
2015-11-23 13:14:46 +00:00
|
|
|
isEmpty(3): \
|
|
|
|
$$1 += $$shell_quote($$shell_path($$OUT_PWD/$$batch_name))
|
|
|
|
else: \
|
|
|
|
$$1 += $$system_quote($$system_path($$OUT_PWD/$$batch_name))
|
|
|
|
QMAKE_DISTCLEAN += $$OUT_PWD/$$batch_name
|
|
|
|
}
|
2012-09-13 16:13:13 +00:00
|
|
|
export($$1)
|
2015-11-23 13:14:46 +00:00
|
|
|
export(QMAKE_DISTCLEAN)
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
2013-06-13 16:12:07 +00:00
|
|
|
# target variable, dependency var name, [non-empty: prepare for system(), not make]
|
2012-09-14 13:38:56 +00:00
|
|
|
defineTest(qtAddTargetEnv) {
|
2013-10-21 19:05:35 +00:00
|
|
|
deps = $$replace($$2, -private$, _private)
|
2015-05-21 10:06:23 +00:00
|
|
|
deps = $$resolve_depends(deps, "QT.", ".depends" ".run_depends")
|
2012-09-14 13:38:56 +00:00
|
|
|
!isEmpty(deps) {
|
2016-09-27 15:31:11 +00:00
|
|
|
libs = libs
|
2015-12-11 13:14:13 +00:00
|
|
|
deppath.CONFIG = prepend
|
2012-10-29 10:18:06 +00:00
|
|
|
equals(QMAKE_HOST.os, Windows) {
|
2016-09-27 15:31:11 +00:00
|
|
|
libs = bins
|
2015-12-11 13:14:13 +00:00
|
|
|
deppath.CONFIG = always_prepend
|
2012-09-14 13:38:56 +00:00
|
|
|
deppath.name = PATH
|
2013-05-10 18:06:57 +00:00
|
|
|
} else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) {
|
2012-09-14 13:38:56 +00:00
|
|
|
deppath.name = LD_LIBRARY_PATH
|
2014-12-16 08:15:26 +00:00
|
|
|
} else:contains(QMAKE_HOST.os, Haiku) {
|
|
|
|
deppath.name = LIBRARY_PATH
|
2012-10-29 10:18:06 +00:00
|
|
|
} else:equals(QMAKE_HOST.os, Darwin) {
|
2016-08-05 11:35:39 +00:00
|
|
|
qtConfig(framework): \
|
2012-10-29 10:18:06 +00:00
|
|
|
deppath.name = DYLD_FRAMEWORK_PATH
|
|
|
|
else: \
|
|
|
|
deppath.name = DYLD_LIBRARY_PATH
|
2013-05-10 18:06:57 +00:00
|
|
|
} else:equals(QMAKE_HOST.os, AIX) {
|
|
|
|
deppath.name = LIBPATH
|
2012-10-29 10:18:06 +00:00
|
|
|
} else {
|
2012-09-14 13:38:56 +00:00
|
|
|
error("Operating system not supported.")
|
2012-10-29 10:18:06 +00:00
|
|
|
}
|
2015-11-20 18:04:11 +00:00
|
|
|
ptypes =
|
|
|
|
for(dep, deps) {
|
|
|
|
isEmpty(3): \
|
2016-09-27 15:31:11 +00:00
|
|
|
deppath += $$shell_path($$eval(QT.$${dep}.$$libs))
|
2015-11-20 18:04:11 +00:00
|
|
|
else: \
|
2016-09-27 15:31:11 +00:00
|
|
|
deppath += $$system_path($$eval(QT.$${dep}.$$libs))
|
2015-11-20 18:04:11 +00:00
|
|
|
ptypes += $$eval(QT.$${dep}.plugin_types)
|
|
|
|
}
|
2012-09-14 13:38:56 +00:00
|
|
|
deppath.value = $$unique(deppath)
|
2012-09-20 10:53:33 +00:00
|
|
|
|
2012-09-14 13:38:56 +00:00
|
|
|
pluginpath.value =
|
2014-05-12 13:30:47 +00:00
|
|
|
ppaths = $$[QT_INSTALL_PLUGINS/get]
|
|
|
|
for(qplug, QT_PLUGINS): \
|
2016-01-02 15:29:15 +00:00
|
|
|
contains(ptypes, $$eval(QT_PLUGIN.$${qplug}.TYPE)): \
|
2014-05-12 13:30:47 +00:00
|
|
|
ppaths += $$eval(QT_PLUGIN.$${qplug}.PATH)
|
|
|
|
ppaths = $$unique(ppaths)
|
|
|
|
for(qplug, ppaths) {
|
|
|
|
isEmpty(3): \
|
|
|
|
pluginpath.value += $$shell_path($$qplug)
|
|
|
|
else: \
|
|
|
|
pluginpath.value += $$system_path($$qplug)
|
2012-09-20 10:53:33 +00:00
|
|
|
}
|
|
|
|
pluginpath.name = QT_PLUGIN_PATH
|
2015-10-27 00:50:45 +00:00
|
|
|
pluginpath.CONFIG = prepend
|
2012-09-20 10:53:33 +00:00
|
|
|
|
2012-09-14 13:38:56 +00:00
|
|
|
QT_TOOL_ENV += deppath pluginpath
|
|
|
|
}
|
2013-06-13 16:12:07 +00:00
|
|
|
qtAddToolEnv($$1, $$QT_TOOL_ENV, $$3)
|
2012-09-14 13:38:56 +00:00
|
|
|
}
|
|
|
|
|
2011-10-19 13:36:33 +00:00
|
|
|
defineReplace(pkgConfigExecutable) {
|
|
|
|
isEmpty(PKG_CONFIG) {
|
2016-10-27 13:43:08 +00:00
|
|
|
!isEmpty(QMAKE_PKG_CONFIG) {
|
|
|
|
# Assumed to be properly sysrootified.
|
2016-01-19 15:48:40 +00:00
|
|
|
PKG_CONFIG = $$QMAKE_PKG_CONFIG
|
2016-10-27 13:43:08 +00:00
|
|
|
export(PKG_CONFIG)
|
|
|
|
} else {
|
2016-01-19 15:48:40 +00:00
|
|
|
PKG_CONFIG = pkg-config
|
2016-10-27 13:43:08 +00:00
|
|
|
!cross_compile {
|
|
|
|
export(PKG_CONFIG)
|
|
|
|
} else {
|
|
|
|
# Cross compiling, ensure that pkg-config is set up sanely.
|
|
|
|
sysroot = $$[QT_SYSROOT]
|
|
|
|
|
|
|
|
pkgConfigLibdir = $$(PKG_CONFIG_LIBDIR)
|
|
|
|
isEmpty(pkgConfigLibdir) {
|
|
|
|
isEmpty(sysroot) {
|
|
|
|
warning("Cross compiling without sysroot. Disabling pkg-config.")
|
|
|
|
return()
|
|
|
|
}
|
|
|
|
!exists("$$sysroot/usr/lib/pkgconfig") {
|
|
|
|
warning("Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and the")
|
|
|
|
warning("host's .pc files would be used (even if you set PKG_CONFIG_PATH).")
|
|
|
|
warning("Set this variable to the directory that contains target .pc files")
|
|
|
|
warning("for pkg-config to function correctly when cross-compiling.")
|
|
|
|
return()
|
|
|
|
}
|
|
|
|
|
|
|
|
pkgConfigLibdir = $$system_path($$sysroot/usr/lib/pkgconfig)$$QMAKE_DIRLIST_SEP$$system_path($$sysroot/usr/share/pkgconfig)
|
|
|
|
!isEmpty(GCC_MACHINE_DUMP): \
|
|
|
|
pkgConfigLibdir = "$$pkgConfigLibdir$$QMAKE_DIRLIST_SEP$$system_path($$sysroot/usr/lib/$$GCC_MACHINE_DUMP/pkgconfig)"
|
|
|
|
message("PKG_CONFIG_LIBDIR automatically set to $$pkgConfigLibdir")
|
|
|
|
}
|
|
|
|
pkgConfigSysrootDir = $$(PKG_CONFIG_SYSROOT_DIR)
|
|
|
|
isEmpty(pkgConfigSysrootDir) {
|
|
|
|
isEmpty(sysroot) {
|
|
|
|
warning("Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.")
|
|
|
|
warning("Set this variable to your sysroot for pkg-config to function")
|
|
|
|
warning("correctly when cross-compiling.")
|
|
|
|
return()
|
|
|
|
}
|
2011-10-19 13:36:33 +00:00
|
|
|
|
2016-10-27 13:43:08 +00:00
|
|
|
pkgConfigSysrootDir = $$sysroot
|
|
|
|
message("PKG_CONFIG_SYSROOT_DIR automatically set to $$pkgConfigSysrootDir")
|
|
|
|
}
|
|
|
|
|
|
|
|
sysroot.name = PKG_CONFIG_SYSROOT_DIR
|
|
|
|
sysroot.value = $$pkgConfigSysrootDir
|
|
|
|
libdir.name = PKG_CONFIG_LIBDIR
|
|
|
|
libdir.value = $$pkgConfigLibdir
|
|
|
|
QT_TOOL_NAME = pkg-config
|
|
|
|
qtAddToolEnv(PKG_CONFIG, sysroot libdir, SYS)
|
|
|
|
}
|
|
|
|
}
|
2011-10-19 13:36:33 +00:00
|
|
|
}
|
|
|
|
|
2017-09-24 05:26:30 +00:00
|
|
|
PKG_CONFIG += 2> $$QMAKE_SYSTEM_NULL_DEVICE
|
2013-08-07 14:21:30 +00:00
|
|
|
|
2011-10-19 13:36:33 +00:00
|
|
|
return($$PKG_CONFIG)
|
|
|
|
}
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
defineTest(packagesExist) {
|
|
|
|
# this can't be done in global scope here because qt_functions is loaded
|
|
|
|
# before the .pro is parsed, so if the .pro set PKG_CONFIG, we wouldn't know it
|
|
|
|
# yet. oops.
|
2011-10-19 13:36:33 +00:00
|
|
|
pkg_config = $$pkgConfigExecutable()
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
for(package, ARGS) {
|
2011-10-19 13:36:33 +00:00
|
|
|
!system($$pkg_config --exists $$package):return(false)
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return(true)
|
|
|
|
}
|
|
|
|
|
2012-10-17 12:13:19 +00:00
|
|
|
# Prepares target that will iterate through all subdirs (except those
|
|
|
|
# with no_default_target or no_{name_of_target}_target. The prepared
|
|
|
|
# target must still be manually added to QMAKE_EXTRA_TARGETS.
|
|
|
|
defineTest(prepareRecursiveTarget) {
|
|
|
|
target = $$1
|
|
|
|
no_$${target}_target: return()
|
|
|
|
|
|
|
|
for(subdir, SUBDIRS) {
|
|
|
|
subdir_config = $$eval($${subdir}.CONFIG)
|
|
|
|
contains(subdir_config, no_default_target): next()
|
|
|
|
contains(subdir_config, no_$${target}_target): next()
|
|
|
|
|
|
|
|
$${target}.recurse += $$subdir
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set up the recurse target only when there
|
|
|
|
# is something to recurse into.
|
|
|
|
isEmpty($${target}.recurse): return()
|
|
|
|
|
|
|
|
$${target}.CONFIG = recursive
|
|
|
|
$${target}.recurse_target = $${target}
|
|
|
|
|
|
|
|
export($${target}.recurse)
|
|
|
|
export($${target}.CONFIG)
|
|
|
|
export($${target}.recurse_target)
|
|
|
|
}
|
2016-08-18 20:24:26 +00:00
|
|
|
|
|
|
|
defineTest(qtConfig) {
|
Modularize the new configure system (infrastructure part)
This change implements the required infrastructure to modularize the new
configuration system.
This requires a hierarchy of configuration files, both for handling
multiple repositories and for individual modules inside the same
repository.
When configuring, they all need to get loaded first, as command line
processing needs to know about all possible command line options.
When the command line has been processed, the individual configuration
files need to get processed one after the other and independently from
each other.
Configure is now automatically invoked when building the a project
tree's "root" project; this works with both modular and top-level builds
of Qt (the latter with an according change in the super repo). As an
immediate consequence, the -skip option moves to the super repo with a
different implementation, as configuration is now done after the repo
list is determined. The option belongs there anyway.
This commit also adds an optional testDir entry to the json file. Like
this, we can still have all configure tests in qtbase/config.tests and
the configuration file in, e.g., corelib can reference those.
The files section can now be left out as long as a 'module' entry is
present, specifying the module name. The names of the files to generate
can then be deduced from that name. We still need to be able to specify
names directly for the global configuration files.
qtConfig() now also queries features which are module-specific. As it is
sometimes necessary to query the configuration of modules which should
not be actually linked (and cannot in the case of subdirs projects), the
new variable QT_FOR_CONFIG which allows specifying configuration-only
dependencies is introduced.
Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: Id1b518a3aa34044748b87fb8fac14d79653f6b18
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-08-25 13:45:44 +00:00
|
|
|
modules = $$QT $$QT_PRIVATE $$QT_FOR_CONFIG
|
|
|
|
modules ~= s,-private$,_private,g
|
|
|
|
modules = $$resolve_depends(modules, "QT.", ".depends")
|
|
|
|
modules += global global_private
|
|
|
|
modules = $$reverse(modules)
|
|
|
|
for (module, modules) {
|
|
|
|
contains(QT.$${module}.enabled_features, $$1): \
|
|
|
|
return(true)
|
|
|
|
contains(QT.$${module}.disabled_features, $$1): \
|
|
|
|
return(false)
|
|
|
|
}
|
2016-08-18 20:24:26 +00:00
|
|
|
error("Could not find feature $${1}.")
|
|
|
|
}
|