Skip to content

qyqx/moc-ng

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

This is really two project:

  * A plugin for clang which removes the needs of running moc
    if your code is compiled with this plugin.

  * A replacement for moc that aim to be compatible with qt's moc,
    but uses the clang libraries for the parsing step.

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

BROWSE SOURCE CODE ONLINE:
http://code.woboq.org/mocng/src/

COMPILE:

You need llvm and clang (3.2 or 3.3).
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:

 * As a binary:  replace the moc provided by Qt by the one which is in src/moc

 * As a clang plugin: Tell your build system not to run moc, and add this to the CXXFLAGS
    -Xclang -load  -Xclang /path/to/src/libmocng_plugin.so -Xclang -add-plugin -Xclang moc

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published