summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-08-19 16:49:13 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-08-20 17:07:46 +0200
commitdf28355981e14c90dc0f214ceeba40be77401fb4 (patch)
treea2eb561965f1d77a68310b1635a910f71347ffa6 /util
parent45d3c75ab6f29e88637363869a3b0be8df731dec (diff)
CMake: Support configure tests of type 'compilerSupportsFlag'
Task-number: QTBUG-86155 Change-Id: Iaa5c48b6508870a0f6afdf9df66cd2e634fe19b3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/configurejson2cmake.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index 5e7036e614..86ebf4bae8 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -768,6 +768,15 @@ def write_compile_test(
# "qmake": "unix:LIBS += -lpthread"
# }
# },
+
+def write_compiler_supports_flag_test(
+ ctx, name, details, data, cm_fh, manual_library_list=None, is_library_test=False
+):
+ cm_fh.write(f"qt_config_compiler_supports_flag_test({featureName(name)}\n")
+ cm_fh.write(lineify("LABEL", data.get("label", "")))
+ cm_fh.write(lineify("FLAG", data.get("flag", "")))
+ cm_fh.write(")\n\n")
+
def parseTest(ctx, test, data, cm_fh):
skip_tests = {
"c11",
@@ -795,6 +804,16 @@ def parseTest(ctx, test, data, cm_fh):
write_compile_test(ctx, test, details, data, cm_fh)
+ if data["type"] == "compilerSupportsFlag":
+ knownTests.add(test)
+
+ if "test" in data:
+ details = data["test"]
+ else:
+ details = test
+
+ write_compiler_supports_flag_test(ctx, test, details, data, cm_fh)
+
elif data["type"] == "libclang":
knownTests.add(test)