[PATCH] Phonon compilation fix under Windows (msvc + mingw)

Tanguy Krotoff tkrotoff at gmail.com
Thu May 29 17:01:46 BST 2008


Here is a small patch against latest Phonon (kdesupport).
Some explanations:

** root CMakeLists.txt
- if(msvc) does not exist if(MSVC) is the correct syntax
- Qt-4.4.0 under Windows (msvc and mingw) does not come (by default)
with DBus support, so:
message(STATUS "Warning: Phonon won't be compiled with DBus support.")
instead of a FATAL_ERROR + other QtDBus issues related.
- ugly hack for getting automoc working under Windows (automoc nmake
install cannot work under Windows)
I guess automoc will be integrated into CMake, that will solve
definitly the problem
- reduce include path, this is just for me (not needed): easier to
debug compilation lines when it is short
that's why I fixed phonon, ds9 and gstreamer backend includes (I don't
have a mac, so I didn't convert qt7 backend - it won't compile)

** phonon/CMakeLists.txt
- fix DBus stuff
- convert to LF (ToirtoiseSVN give me some pb)

** phonon/lockfreequeue_p.h
- avoid msvc warning: NodeBase was previously declared as a struct

** ds9/CMakeLists.txt:
- UNICODE is needed for mingw and also for msvc
- kde4_add_plugin() replaced by add_library() + automoc4()
- remove target_link with kdelibs

** ds9/*.cpp *.h
- Change #include <qdebug.h> to #include <QtCore/QDebug> in order to
be consistent with the rest of the code
this allow ds9 backend to be compiled with having all Qt modules
inside the include path

** ds9/audiooutput.cpp
- implement virtual pure method: setOutputDevice(const
AudioOutputdevice &) -> needs to be checked

** ds9/backend.cpp
- remove K_PLUGIN_FACTORY stuff (kdelibs related)

** phonon/tests/CMakeLists.txt
- fix target_link issue

** cmake/FindAutomoc4.cmake
- convert to LF (ToirtoiseSVN give me some pb)

** automoc/CMakeLists.txt
- remove -W flag when using mingw: gives tones of warnings with Qt-4.4.0
btw it would be good to have only one place (factorization) where CC
flags are set
this code is duplicated inside phonon' CMakeLists.txt
- convert to LF (ToirtoiseSVN give me some pb)

I've tested it under Linux and Windows (msvc 2005 + mingw)
btw there a lot of warnings if you try to compile phonon using CMake-2.6

Tanguy Krotoff <tkrotoff at gmail.com>
+33 6 68 42 70 24
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Automoc4Config_flags_mingw.diff
Type: application/octet-stream
Size: 856 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080529/13cc051f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phonon_msvcfix.diff
Type: application/octet-stream
Size: 14720 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080529/13cc051f/attachment-0001.obj>

More information about the kde-core-devel mailing list