From e80bf655e922e9864f8843b5e7bbb47019a6d95a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 7 Dec 2017 19:30:07 +0100 Subject: configure: verify header presence against sources in addition to the actual library resolution, also resolve the headers belonging to the library, to validate the include path, and possibly ensure that the right version of the library is present. the "include" entries were moved out of the "test" objects, and renamed to "headers". this cleanly permits libraries without compile tests. the headers were not put into the sources, because the variance among the includes is generally orthogonal to the variance among the libraries. note that this - like the library resolution - provides no support for darwin frameworks. consequently, the opengl libraries are excluded from the conversion on darwin. similarly, wasm is excluded (centrally), because emcc is magic and would need advanced wizardry to be dealt with. Change-Id: Ib390c75371efa2badcfec9b74274047ce67c3e5a Reviewed-by: Joerg Bornemann Reviewed-by: Paul Wicking --- mkspecs/features/qt_configure.prf | 58 ++++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 7 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index e2e341770e..3483ddc5dc 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -582,7 +582,33 @@ defineTest(qtConfResolvePathLibs) { return($$ret) } -# includes-var, includes +defineReplace(qtConfGetTestIncludes) { + defined($${1}._KEYS_, var) { + 1st = $$first($${1}._KEYS_) + equals(1st, 0) { + # array; recurse for every element + ret = + for (k, $${1}._KEYS_): \ + ret += $$qtConfGetTestIncludes($${1}.$$k) + return($$ret) + } + # object; try condition and recurse + !defined($${1}.headers, var):!defined($${1}.headers._KEYS_, var): \ # just plain broken without it + error("headers object '$$1' has no nested headers entry") + cond = $$eval($${1}.condition) + isEmpty(cond): \ # would be pointless otherwise + error("headers object '$$1' has no condition") + !$$qtConfEvaluate($$cond) { + qtLog("header entry '$$1' failed condition '$$cond'.") + return() + } + qtLog("header entry '$$1' passed condition.") + return($$qtConfGetTestIncludes($${1}.headers)) + } + return($$eval($$1)) # plain string - or nothing (can happen for top-level call only) +} + +# includes-var, in-paths, test-object-var defineTest(qtConfResolvePathIncs) { ret = true for (incdir, 2) { @@ -594,6 +620,21 @@ defineTest(qtConfResolvePathIncs) { 2 -= $$QMAKE_DEFAULT_INCDIRS $$1 = $$2 export($$1) + wasm { + # FIXME: emcc downloads pre-built libraries and adds their include + # path to the clang call dynamically. it would be possible to parse + # the emcc -s USE_xyz=1 --cflags output to populate xzy_INCDIR and + # thus make the code below work. + return($$ret) + } + hdrs = $$qtConfGetTestIncludes($${3}.headers) + for (hdr, hdrs) { + h = $$qtConfFindInPathList($$hdr, $$2 $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS) + isEmpty(h) { + qtLog("$$hdr not found in [$$val_escape(2)] and global paths.") + ret = false + } + } return($$ret) } @@ -662,7 +703,7 @@ defineTest(qtConfLibrary_inline) { !qtConfResolveAllLibs($$1): \ return(false) - !qtConfResolvePathIncs($${1}.includedir, $$includes): \ + !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \ return(false) return(true) @@ -678,7 +719,7 @@ defineTest(qtConfLibrary_makeSpec) { !qtConfResolvePathLibs($${1}.libs, $$eval(QMAKE_LIBDIR_$$spec), $$eval(QMAKE_LIBS_$$spec)): \ return(false) - !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec)): \ + !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec), $$2): \ return(false) # note that the object is re-exported, because we resolve the libraries. @@ -741,7 +782,7 @@ defineTest(qtConfLibrary_pkgConfig) { } !isEmpty(ignored): \ qtLog("Note: Dropped compiler flags '$$ignored'.") - !qtConfResolvePathIncs($${1}.includedir, $$includes): \ + !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \ return(false) $${1}.defines = $$defines @@ -1054,7 +1095,7 @@ defineTest(qtConfTestPrepare_compile) { } defineTest(qtConfPrepareCompileTestSource) { - test_dir = $$2 + test_dir = $$3 test_lang = $$eval($${1}.lang) isEmpty(test_lang): test_lang = "c++" @@ -1071,7 +1112,10 @@ defineTest(qtConfPrepareCompileTestSource) { for (ent, $$qtConfScalarOrList($${1}.head)): \ contents += $$ent # Includes - for (ent, $$qtConfScalarOrList($${1}.include)): \ + hdrs = $$qtConfGetTestIncludes($${1}.include) + isEmpty(hdrs): \ + hdrs = $$qtConfGetTestIncludes($$2) + for (ent, hdrs): \ contents += "$${LITERAL_HASH}include <$$ent>" # Custom code after includes for (ent, $$qtConfScalarOrList($${1}.tail)): \ @@ -1107,7 +1151,7 @@ defineTest(qtConfTest_compile) { isEmpty(test) { test_dir = $$test_base_out_dir/$$section(1, ".", -1) test_out_dir = $$test_dir - qtConfPrepareCompileTestSource($${1}.test, $$test_dir) + qtConfPrepareCompileTestSource($${1}.test, $${1}.headers, $$test_dir) } else { test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_out_dir = $$test_base_out_dir/$$test -- cgit v1.2.3 From b34143f8a19040a457d399a22f0bde53ac327ff1 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Tue, 11 Dec 2018 00:52:36 +0800 Subject: Fix clang LTCG config on Windows To enable LTCG, clang-cl.exe need "-flto" instead of "-GL". But if you enabled LTO, the lib tool will have to change to "llvm-lib.exe" and the link tool also need to change to "lld-link.exe", because msvc linker will see these lib files as corrupted files. Leave QMAKE_LFLAGS_LTCG empty because lld-link doesn't need any additional parameters. Fixes: QTBUG-72402 Change-Id: Ia34d98bd1ad919d542ea3eac83944bf8c40ce0cd Reviewed-by: Thiago Macieira Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- mkspecs/win32-clang-msvc/qmake.conf | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/win32-clang-msvc/qmake.conf b/mkspecs/win32-clang-msvc/qmake.conf index ba9704e069..027f93ca6e 100644 --- a/mkspecs/win32-clang-msvc/qmake.conf +++ b/mkspecs/win32-clang-msvc/qmake.conf @@ -15,6 +15,14 @@ QMAKE_CFLAGS += -Wno-microsoft-enum-value QMAKE_CXXFLAGS += -Wno-microsoft-enum-value +QMAKE_LINK = lld-link +QMAKE_LIB = llvm-lib /NOLOGO + +QMAKE_CFLAGS_LTCG = -flto +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +# Leave QMAKE_LFLAGS_LTCG empty because lld-link doesn't need any additional parameters +QMAKE_LFLAGS_LTCG = + # Precompiled headers are not supported yet by clang CONFIG -= precompile_header -- cgit v1.2.3 From bd05a009f0f9119dccf912550a6b44f825a9400b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 16:11:01 +0100 Subject: configure: add "we mean it" blurb like all qt_*.prf files (exceptions prove the rule), the configure system counts as private api. Change-Id: Iea3057445e430029ecd8449e604e2d5c499ae10a Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 3483ddc5dc..c854a31f55 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1,3 +1,13 @@ +# +# 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. +# QT_CONFIGURE_REPORT = QT_CONFIGURE_NOTES = -- cgit v1.2.3 From cf51bcba10af20b6c603c34f0be99b7c34f6a8f7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 17:37:10 +0200 Subject: configure: allow libraries to create explicitly empty tests this allows compile-testing the specified headers with no further tests. Change-Id: I268ff328deee221d9b92386fe2bd133b19a6f8e2 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index c854a31f55..fe14ea1f40 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -982,7 +982,7 @@ defineTest(qtConfHandleLibrary) { export($${lpfx}.source) # if the library defines a test, use it to verify the source. - !isEmpty($${lpfx}.test)|!isEmpty($${lpfx}.test._KEYS_) { + defined($${lpfx}.test, var)|defined($${lpfx}.test._KEYS_, var) { $${lpfx}.resolved_uses = $$currentConfig:$$1 $${lpfx}.host = $$eval($${spfx}.host) !qtConfTest_compile($$lpfx) { -- cgit v1.2.3 From 32aa6734d445e1eed38e55ee03af4267ab6cd2c7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 17:49:43 +0100 Subject: configure: add support for multiple libdirs in inline library sources while the command line doesn't actually permit it (that can be re-evaluated separately), derivatives of the inline source type may want to inject additional paths, as is the case with opcua. the incdir field supports multiple entries without additional action. Change-Id: I3860ca1fc8fab25c04eb63bdb2f855b77ff3b9a4 Reviewed-by: Rainer Keller Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index fe14ea1f40..5798a8a27b 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -707,8 +707,12 @@ defineTest(qtConfLibrary_inline) { } libdir = $$eval(config.input.$${input}.libdir) - !isEmpty(libdir): \ - $${1}.libs = -L$$libdir $$eval($${1}.libs) + !isEmpty(libdir) { + libs = + for (ld, libdir): \ + libs += -L$$ld + $${1}.libs = $$libs $$eval($${1}.libs) + } !qtConfResolveAllLibs($$1): \ return(false) -- cgit v1.2.3 From a8207699ce282cdcaa9423374fdad20a63897d25 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Nov 2017 19:48:33 +0100 Subject: configure: normalize dashes to underscores in exported libraries it works without it, but technically speaking it's undefined behavior. Change-Id: Icdcdd5b923ce4cecd9dc9e75f9d5d66d0fa8a032 Reviewed-by: Joerg Bornemann --- mkspecs/features/qmake_use.prf | 6 +++--- mkspecs/features/qt_configure.prf | 16 ++++++++-------- mkspecs/features/qt_helper_lib.prf | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf index 8159e471a2..64faa4f215 100644 --- a/mkspecs/features/qmake_use.prf +++ b/mkspecs/features/qmake_use.prf @@ -5,14 +5,14 @@ for(ever) { for (use, QMAKE_USE$${suffix}) { use = $$split(use, /) name = $$take_first(use) - nu = $$upper($$name) + nu = $$upper($$replace(name, -, _)) !contains(use, linkonly): CC_USES += $$nu !contains(use, nolink): LD_USES += $$nu } CC_USES = $$resolve_depends(CC_USES, QMAKE_DEPENDS_, _CC) for (nu, CC_USES) { !defined(QMAKE_LIBS_$$nu, var): \ - error("Library '$$lower($$nu)' is not defined.") + error("Library '$$lower($$replace(nu, _, -))' is not defined.") DEFINES += $$eval(QMAKE_DEFINES_$${nu}) INCLUDEPATH += $$eval(QMAKE_INCDIR_$${nu}) @@ -20,7 +20,7 @@ for(ever) { LD_USES = $$resolve_depends(LD_USES, QMAKE_DEPENDS_, _LD) for (nu, LD_USES) { !defined(QMAKE_LIBS_$$nu, var): \ - error("Library '$$lower($$nu)' is not defined.") + error("Library '$$lower($$replace(nu, _, -))' is not defined.") debug: \ LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 5798a8a27b..83802cffca 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -439,12 +439,12 @@ defineTest(qtConfSetupLibraries) { lpfx = $${currentConfig}.libraries.$${l} # 'export' may be omitted, in which case it falls back to the library's name !defined($${lpfx}.export, var) { - $${lpfx}.export = $$l + $${lpfx}.export = $$replace(l, -, _) export($${lpfx}.export) } # 'export' may also be empty, but we need a derived identifier alias = $$eval($${lpfx}.export) - isEmpty(alias): alias = $$l + isEmpty(alias): alias = $$replace(l, -, _) $${lpfx}.alias = $$alias export($${lpfx}.alias) # make it easy to refer to the library by its export name. @@ -804,7 +804,7 @@ defineTest(qtConfLibrary_pkgConfig) { largs = $$qtConfAllLibraryArgs($$eval($${2}.dependencies)) for (la, largs): \ eval("$$la") - USES = $$eval($$list($$upper($$QMAKE_USE))) + USES = $$eval($$list($$upper($$replace(QMAKE_USE, -, _)))) # _CC == _LD for configure's library sources, so pick first arbitrarily. DEPS = $$resolve_depends(USES, QMAKE_DEPENDS_, _CC) for (DEP, DEPS) { @@ -837,7 +837,7 @@ defineTest(qtConfTest_getPkgConfigVariable) { } defineReplace(qtConfLibraryArgs) { - NAME = $$upper($$eval($${1}.library)) + NAME = $$upper($$replace($${1}.library, -, _)) qmake_args = "QMAKE_LIBS_$${NAME} = $$val_escape($${1}.libs)" for (b, $${1}.builds._KEYS_): \ qmake_args += "QMAKE_LIBS_$${NAME}_$$upper($$b) = $$val_escape($${1}.builds.$${b})" @@ -853,8 +853,8 @@ defineReplace(qtConfLibraryArgs) { for (use, depends): \ dep_uses += $$section(use, :, 1, 1) qmake_args += \ - "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$dep_uses)" \ - "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$dep_uses)" + "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$replace(dep_uses, -, _))" \ + "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$replace(dep_uses, -, _))" } return($$qmake_args) } @@ -917,7 +917,7 @@ defineTest(qtConfExportLibrary) { !isEmpty(use_cfg): \ depends += $$upper($$eval($${use_cfg}.libraries.$${use_lib}.export)) else: \ - depends += $$upper($$use_lib) + depends += $$upper($$replace(use_lib, -, _)) } # we use suffixes instead of infixes, because $$resolve_depends() demands it. qtConfOutputVar(assign, $$output, QMAKE_DEPENDS_$${NAME}_CC, $$depends) @@ -1092,7 +1092,7 @@ defineTest(qtConfTestPrepare_compile) { } } isEmpty(libConfig) { - nu = $$upper($$u) + nu = $$upper($$replace(u, -, _)) !defined(QMAKE_LIBS_$$nu, var): \ error("Test $$1 tries to use undeclared library '$$u'") # using an external library by exported name. diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf index 05d3b941bd..2cb54fc547 100644 --- a/mkspecs/features/qt_helper_lib.prf +++ b/mkspecs/features/qt_helper_lib.prf @@ -31,6 +31,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET) !build_pass { MODULE = $$replace(TARGET, ^qt, ) + MODULE ~= s,-,_, MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri ucmodule = $$upper($$MODULE) @@ -46,7 +47,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET) for (use, QMAKE_USE) { use = $$split(use, /) name = $$take_first(use) - nu = $$upper($$name) + nu = $$upper($$replace(name, -, _)) !contains(use, linkonly): CC_USES += $$nu !contains(use, nolink): LD_USES += $$nu } -- cgit v1.2.3 From 6b39d51a2c39569f984ef90e905bdf43958f5431 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 18:33:17 +0200 Subject: configure: enable sharing of inlined source code between tests this is implemented by means of (multiple) inheritance, which applies specifically only to the inlined source and header list, but not to library sources or dependencies. Change-Id: I8f1d5b34d1d2d12e39225dc50357ad6ec648c6b6 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 59 +++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 18 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 83802cffca..72bbd42fa5 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -592,6 +592,16 @@ defineTest(qtConfResolvePathLibs) { return($$ret) } +defineReplace(qtConfGetTestSourceList) { + result = + !isEmpty($${1}.test.inherit) { + base = $$section(1, ., 0, -2) + for (i, $${1}.test.inherit): \ + result += $$qtConfGetTestSourceList($${base}.$$i) + } + return($$result $$1) +} + defineReplace(qtConfGetTestIncludes) { defined($${1}._KEYS_, var) { 1st = $$first($${1}._KEYS_) @@ -637,7 +647,10 @@ defineTest(qtConfResolvePathIncs) { # thus make the code below work. return($$ret) } - hdrs = $$qtConfGetTestIncludes($${3}.headers) + tests = $$qtConfGetTestSourceList($$3) + hdrs = + for (test, tests): \ + hdrs += $$qtConfGetTestIncludes($${test}.headers) for (hdr, hdrs) { h = $$qtConfFindInPathList($$hdr, $$2 $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS) isEmpty(h) { @@ -1109,10 +1122,14 @@ defineTest(qtConfTestPrepare_compile) { } defineTest(qtConfPrepareCompileTestSource) { - test_dir = $$3 + test_dir = $$2 - test_lang = $$eval($${1}.lang) - isEmpty(test_lang): test_lang = "c++" + tests = $$qtConfGetTestSourceList($$1) + + test_lang = "c++" + for (test, tests): \ + test_lang += $$eval($${test}.test.lang) + test_lang = $$last(test_lang) # Last non-empty, that is. equals(test_lang, "c++"): suffix = "cpp" else: equals(test_lang, "c"): suffix = "c" @@ -1123,25 +1140,30 @@ defineTest(qtConfPrepareCompileTestSource) { # Create source code contents = "/* Generated by configure */" # Custom code before includes - for (ent, $$qtConfScalarOrList($${1}.head)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.head)): \ + contents += $$ent # Includes - hdrs = $$qtConfGetTestIncludes($${1}.include) - isEmpty(hdrs): \ - hdrs = $$qtConfGetTestIncludes($$2) - for (ent, hdrs): \ - contents += "$${LITERAL_HASH}include <$$ent>" + for (test, tests) { + hdrs = $$qtConfGetTestIncludes($${test}.test.include) + isEmpty(hdrs): \ + hdrs = $$qtConfGetTestIncludes($${test}.headers) + for (ent, hdrs): \ + contents += "$${LITERAL_HASH}include <$$ent>" + } # Custom code after includes - for (ent, $$qtConfScalarOrList($${1}.tail)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.tail)): \ + contents += $$ent # And finally the custom code inside main() contents += \ "int main(int argc, char **argv)" \ "{" \ " (void)argc; (void)argv;" \ " /* BEGIN TEST: */" - for (ent, $$qtConfScalarOrList($${1}.main)): \ - contents += " $$ent" + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.main)): \ + contents += " $$ent" contents += \ " /* END TEST */" \ " return 0;" \ @@ -1151,8 +1173,9 @@ defineTest(qtConfPrepareCompileTestSource) { # Create stub .pro file contents = "SOURCES = main.$$suffix" # Custom project code - for (ent, $$qtConfScalarOrList($${1}.qmake)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.qmake)): \ + contents += $$ent write_file($$test_dir/$$basename(test_dir).pro, contents)|error() } @@ -1165,7 +1188,7 @@ defineTest(qtConfTest_compile) { isEmpty(test) { test_dir = $$test_base_out_dir/$$section(1, ".", -1) test_out_dir = $$test_dir - qtConfPrepareCompileTestSource($${1}.test, $${1}.headers, $$test_dir) + qtConfPrepareCompileTestSource($$1, $$test_dir) } else { test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_out_dir = $$test_base_out_dir/$$test -- cgit v1.2.3 From 73b8769730701736cd0d05f904b69f2e7e35de1d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 21:25:12 +0200 Subject: configure: enable inline tests to contain auxiliary files ... and use that to migrate the pch test. Change-Id: I2ce884442cab6124c37142f571cf6f82191ee4f5 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 72bbd42fa5..f5aa444ade 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1170,6 +1170,11 @@ defineTest(qtConfPrepareCompileTestSource) { "}" write_file($$test_dir/main.$$suffix, contents)|error() + for (test, tests) { + for (file, $$qtConfScalarOrList($${test}.test.files._KEYS_)): \ + write_file($$test_dir/$$file, $$qtConfScalarOrList($${test}.test.files.$${file}))|error() + } + # Create stub .pro file contents = "SOURCES = main.$$suffix" # Custom project code -- cgit v1.2.3 From 98689cd2f9d3e9e4dac33ccf6679b90d4b39284f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 16 Jul 2018 12:10:19 +0200 Subject: configure: enable inline tests to refer to PWD ... and use that to inline the xlocalescanprint test. Change-Id: I0973133d7f9ecc9a38b70dc4b83df174a35b2b1f Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index f5aa444ade..87190bc52a 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1178,9 +1178,10 @@ defineTest(qtConfPrepareCompileTestSource) { # Create stub .pro file contents = "SOURCES = main.$$suffix" # Custom project code + pwd = $$val_escape($${currentConfig}.dir) for (test, tests): \ for (ent, $$qtConfScalarOrList($${test}.test.qmake)): \ - contents += $$ent + contents += $$replace(ent, "@PWD@", $$pwd) write_file($$test_dir/$$basename(test_dir).pro, contents)|error() } -- cgit v1.2.3 From 49c8595bf8f4563656498be9f99448526338acb3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Dec 2018 21:18:18 +0100 Subject: qmake: fix typo in function name Change-Id: Ie88ae0f13be83d6e63078eeb359d9ddf012c94fb Reviewed-by: Joerg Bornemann --- mkspecs/features/toolchain.prf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index c7ea20e180..1a76e50b49 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -9,7 +9,7 @@ defineReplace(qtMakeExpand) { } } -defineTest(qtCompilerErrror) { +defineTest(qtCompilerError) { !cross_compile: \ what = else: host_build: \ @@ -69,7 +69,7 @@ isEmpty($${target_prefix}.INCDIRS) { cxx_flags += -E -v output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output) rim_qcc { for (line, output) { @@ -129,7 +129,7 @@ isEmpty($${target_prefix}.INCDIRS) { # What's more, -print-search-dirs can't be used on clang on Apple because it # won't print all the library paths (only the clang-internal ones). output = $$system("$$cmd_prefix $$QMAKE_LINK $$QMAKE_LFLAGS -print-search-dirs", lines, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_LINK, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_LINK, $$output) for (line, output) { contains(line, "^libraries: .*") { @@ -149,7 +149,7 @@ isEmpty($${target_prefix}.INCDIRS) { } else: ghs { cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp output = $$system("$$cmd", blob, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output) output ~= s/\\\\\\n {8}//g output = $$split(output, $$escape_expand(\\n)) for (line, output) { @@ -199,14 +199,14 @@ isEmpty($${target_prefix}.INCDIRS) { defineReplace(qtVariablesFromMSVC) { ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec) - !equals(ec, 0): qtCompilerErrror($$1, $$ret) + !equals(ec, 0): qtCompilerError($$1, $$ret) return($$ret) } defineReplace(qtVariablesFromGCC) { ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \ 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec) - !equals(ec, 0): qtCompilerErrror($$1, $$ret) + !equals(ec, 0): qtCompilerError($$1, $$ret) return($$ret) } -- cgit v1.2.3 From e0926ca4260953a70cdb2a6f84da35517ead1349 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 19 Dec 2018 17:54:46 +0100 Subject: qmake: remove support for pre-5.6 qt module pris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it seems rather obsolete by now. Change-Id: I43a84367fbe9f82c3adc0e3825d14198e69eaa1f Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt.prf | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index d16b3cf1be..5da82fdb5b 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -198,28 +198,6 @@ for(ever) { MODULE_LIBS_ADD = $$MODULE_LIBS MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS - !contains(MODULE_CONFIG, v2) { - # Backwards compatibility with pre-5.6 module .pri files - - contains(MODULE_CONFIG, lib_bundle) { - MODULE_FRAMEWORKS = $$MODULE_LIBS - inc = $$MODULE_LIBS/$${MODULE_NAME}.framework/Headers - MODULE_INCLUDES = $$inc - contains(MODULE_CONFIG, internal_module): \ - MODULE_INCLUDES += \ - $$inc/$$eval(QT.$${QTLIB}.VERSION) \ - $$inc/$$eval(QT.$${QTLIB}.VERSION)/$$MODULE_NAME - } else { - # Re-insert the major version in the library name (cf qt5LibraryTarget above) - MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION, - } - - # Only link to this module if a libs directory is set, else this is just a module - # to give access to sources or include files, and not for linking. - !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link): \ - MODULE_MODULE = $${MODULE_NAME}$${QT_LIBINFIX} - } - # Frameworks shouldn't need include paths, but much code does not use # module-qualified #includes, so by default we add paths which point # directly into the frameworks. Private modules have somewhat convoluted -- cgit v1.2.3 From 5af60d3b371360285af442d1ee194b44d681f297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 10 Dec 2018 23:37:54 +0100 Subject: macOS: Prevent checking for stale SDK without the required SDK name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no need to check the SDK at the root exclusive-build Makefile, we can leave it to the individual build passes where the SDK variable is available. Fixes: QTBUG-72449 Change-Id: Ic829babf4c76e6d20812de0b94120199ebfb300c Reviewed-by: Morten Johan Sørvig Reviewed-by: Tor Arne Vestbø --- mkspecs/features/mac/default_post.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs') diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 3881b432ef..8e2c5e603a 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,7 +1,7 @@ load(default_post) contains(TEMPLATE, .*app) { - !macx-xcode { + !macx-xcode:if(isEmpty(BUILDS)|build_pass) { # Detect changes to the platform SDK QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_XCODE_DEVELOPER_PATH QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk) -- cgit v1.2.3