summaryrefslogtreecommitdiffstats
path: root/util/cmake
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2019-10-09 15:18:56 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2019-10-10 12:10:56 +0000
commitfbf27595984f79787588bf4c59217ae6707313a3 (patch)
tree60b9dc72ebc3b75a909d68021e9acb7d0dc10c46 /util/cmake
parent06fdea1ce570e0dae86e33f485e429fefacda0fa (diff)
cmake scripts: add mapping for mkspec conditions
Improves for example tests/auto/tools/moc/moc.pro conversion. Change-Id: I80f82be75299a0407be510824df35f0ea101c0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util/cmake')
-rwxr-xr-xutil/cmake/pro2cmake.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 52b2c93d3e..6e9f53aa3f 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -1571,6 +1571,13 @@ def map_condition(condition: str) -> str:
condition = re.sub(r"\s*==\s*", "___STREQUAL___", condition)
condition = re.sub(r"\bexists\s*\((.*?)\)", r"EXISTS \1", condition)
+ # checking mkspec, predating gcc scope in qmake, will then be replaced by platform_mapping in helper.py
+ condition = condition.replace("*-g++*", "GCC")
+ condition = condition.replace("*-icc*", "ICC")
+ condition = condition.replace("*-clang*", "CLANG")
+ condition = condition.replace("*-llvm", "CLANG")
+ condition = condition.replace("win32-*", "WIN32")
+
pattern = r"CONFIG\((debug|release),debug\|release\)"
match_result = re.match(pattern, condition)
if match_result: