Michael Rutman
2010-08-24 17:48:56 UTC
I have simplified this to a simple example. I know it won't actually compile but the moc step should still be run.
The SConstruct is:
env = Environment(tools = ['default','qt'],
QTDIR="~miker/widevine/ThirdParty/qt-all-opensource-src-4.5.3/"
)
env['QT_DEBUG'] = 1
env.Program(Split('qttest.cpp'))
The source for qttest.cpp is
class Foo
{
Q_OBJECT
};
Like I said, I simplified it down to the most trivial example I could think of to force the creation of a moc file.
My output is:
scons
scons: Reading SConscript files ...
scons: qt: no header for 'qttest.cpp'.
scons: qt: found Q_OBJECT macro in 'qttest.cpp', moc'ing to '['qttest.moc']'
scons: done reading SConscript files.
scons: Building targets ...
g++ -o qttest.o -c -I~miker/widevine/ThirdParty/qt-all-opensource-src-4.5.3/include qttest.cpp
qttest.cpp:4: error: ISO C++ forbids declaration of 'Q_OBJECT' with no type
qttest.cpp:5: error: expected ';' before '}' token
qttest.cpp:5: error: expected `;' before '}' token
scons: *** [qttest.o] Error 1
scons: building terminated because of errors.
So, the qt found that it needs to create the qttest.moc file, it just doesn't make it.
I have tried adding qttest.moc to env.Program. Then I get:
scons: qt: 'qttest.moc' seems to be a binary. Discarded.
Any simple examples that show a moc actually happen?
Thanks
------------------------------------------------------
http://scons.tigris.org/ds/viewMessage.do?dsForumId=1272&dsMessageId=2650747
To unsubscribe, send an e-mail to [users-***@scons.tigris.org].
The SConstruct is:
env = Environment(tools = ['default','qt'],
QTDIR="~miker/widevine/ThirdParty/qt-all-opensource-src-4.5.3/"
)
env['QT_DEBUG'] = 1
env.Program(Split('qttest.cpp'))
The source for qttest.cpp is
class Foo
{
Q_OBJECT
};
Like I said, I simplified it down to the most trivial example I could think of to force the creation of a moc file.
My output is:
scons
scons: Reading SConscript files ...
scons: qt: no header for 'qttest.cpp'.
scons: qt: found Q_OBJECT macro in 'qttest.cpp', moc'ing to '['qttest.moc']'
scons: done reading SConscript files.
scons: Building targets ...
g++ -o qttest.o -c -I~miker/widevine/ThirdParty/qt-all-opensource-src-4.5.3/include qttest.cpp
qttest.cpp:4: error: ISO C++ forbids declaration of 'Q_OBJECT' with no type
qttest.cpp:5: error: expected ';' before '}' token
qttest.cpp:5: error: expected `;' before '}' token
scons: *** [qttest.o] Error 1
scons: building terminated because of errors.
So, the qt found that it needs to create the qttest.moc file, it just doesn't make it.
I have tried adding qttest.moc to env.Program. Then I get:
scons: qt: 'qttest.moc' seems to be a binary. Discarded.
Any simple examples that show a moc actually happen?
Thanks
------------------------------------------------------
http://scons.tigris.org/ds/viewMessage.do?dsForumId=1272&dsMessageId=2650747
To unsubscribe, send an e-mail to [users-***@scons.tigris.org].