diff options
Diffstat (limited to 'xmake/languages/objc++/check_main.lua')
| -rw-r--r-- | xmake/languages/objc++/check_main.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/languages/objc++/check_main.lua b/xmake/languages/objc++/check_main.lua index 462ad4c6c..87a2002ae 100644 --- a/xmake/languages/objc++/check_main.lua +++ b/xmake/languages/objc++/check_main.lua @@ -27,8 +27,12 @@ function main(sourcefile) -- load source code local sourcecode = io.read(sourcefile) + -- remove comment first + sourcecode = sourcecode:gsub("/%*.-%*/", "") + sourcecode = sourcecode:gsub("//.-\n", "\n") + -- find int main(int argc, char** argv) {} - if sourcecode:find("%s+main%s*%(.*%)") then + if sourcecode:find("%s+main%s*%(.-%)") then return true end |
