Home

Awesome

moc-ng: a replacement for Qt's moc that is using clang libraries

This is really two projects:

Read the blog post: https://woboq.com/blog/moc-with-clang.html

Build Status

Browse the source code online

https://code.woboq.org/mocng/src/

Compile

You need llvm and clang (>= 3.4). Then run cmake and make (adapt your paths)

cmake . -DCMAKE_CXX_COMPILER=/opt/llvm/bin/clang++ -DLLVM_CONFIG_EXECUTABLE=/opt/llvm/bin/llvm-config make

Use

Differences with upstream moc

This version of moc has nice additional support compared to upstream moc:

Not supported:

Problems?

Make sure that the Qt include paths (and other include paths) are correctly passed to moc via the -I option

Report bugs on github: https://github.com/woboq/moc-ng/issues

Tests

Replace the moc binary in the builddir (qtbase/bin/moc) and run the Qt tests. Expecially the tst_moc and the tests for corelib/kernel. The tests that are known to fail are worked around in "workaroundtests.cpp". Tests for features not supported by normal Qt (such as templates) are found in the tests subdirectory. Check the README in the tests subdirectory for the moc-ng specific tests