Windows patches
Stephen Kelly
steveire at gmail.com
Wed Jul 4 14:20:05 UTC 2012
Patrick Spendrin wrote:
> Hi everybody,
>
> I am now half way through building kdelibs frameworks branch on windows.
>
> Some things I want to mention:
> - most unittests are console applications on Windows and so they need to
> be linked against the stub library qtmain.lib. I committed a patch which
> does this already for quite a lot of the tests etc. but since this ugly
> and easy to forget it would be really cool if we could get this in cmake
> itself and have a way to link against a stub library if a non-GUI
> application is built (like a LINK_INTERFACE).
This surprises me. I always thought it was gui applications that need to
link to qtmain.lib. Funny how easy it is to get the wrong idea... :)
I'm also surprised because we use set(CMAKE_WIN32_EXECUTABLE ON) in ecm to
create WIN32_EXECUTABLEs by default. This might mean that the feature is
broken in cmake (I added it in CMake 2.8.8), so please provide more
information.
> Since this will not happen before at least 2.8.10, I will fix this in
> the ugly way for now.
>
> - A lot of KDE libraries can be build without using kdewin (which is
> kind of a posix compat layer), so I try to get libraries working without
> it first. I won't succeed on all libraries though.
It might make sense to get as much as possible into Qt. For example, create
a qSetEnv which calls ::setenv or SetEnvironmentVariable.
Additionally, instead of changes like
+#if defined(Q_CC_MSVC)
+#undef interface
+#endif
we should prefer to rename the 'interface' variable to something else.
Especially as it is in a private file in this case, but also for public API
which conflicts, we should consider changing the API.
> - due to the way our generate export header script works, some adaptions
> are needed for building & linking static libraries (you need to set a
> -D${TARGET}_STATIC_DEFINE=1). If possible this should be moved to a
> property in cmake as well.
Yes, hopefully easy with CMake 2.8.10.
> Please comment on these issues! ;-)
Thanks for your efforts on this,
Steve.
More information about the Kde-frameworks-devel
mailing list