diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2013-06-03 13:33:01 +0200 |
---|---|---|
committer | Pierre Rossi <pierre.rossi@digia.com> | 2013-06-03 13:34:36 +0200 |
commit | 3513626dbd2f4d3a4bccf801cae5c9f8f005ba13 (patch) | |
tree | fcae41bbe8f8b6ad2aee1776e47fa0fdaf908eb7 /build | |
parent | 96e116f3a890eb4f37dc557b6d6bc4f640b2671b (diff) |
Support commenting out the Q_OBJECT macro
We shouldn't try to run moc on such files...
Diffstat (limited to 'build')
-rwxr-xr-x | build/scripts/find-mocables | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/build/scripts/find-mocables b/build/scripts/find-mocables index c4520660a..7c383cfec 100755 --- a/build/scripts/find-mocables +++ b/build/scripts/find-mocables @@ -4,7 +4,22 @@ import re, sys, os mocables = set() for f in filter(os.path.isfile, sys.argv[1:]): + inBlockComment = False for line in open(f).readlines(): + # Block comments handling + if "/*" in line: + inBlockComment = True + if inBlockComment and "*/" in line: + inBlockComment = False + if line.find("*/") != len(line) - 3: + line = line[line.find("*/")+2:] + else: + continue + if inBlockComment: + continue + #simple comments handling + if "//" in line: + line = line.partition("//")[0] if re.match(".*Q_OBJECT", line): mocables.add(f) for mocable in mocables: |