<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi everyone<br><br>This commit actually brought into surface a problem with the compilation process under MSVC. To illustrate, here<br>is the current compilation process under MSVC:<br><br>1>------ Build started: Project: kyra, Configuration: Debug Win32 ------<br>1> ..\..\engines\kyra\screen.cpp<br>(ENABLE_KYRA not defined - snipped loads of errors)<br>1>kyra - 26 error(s), 1 warning(s)<br>2>------ Build started: Project: scummvm, Configuration: Debug Win32 ------<br>2>Compiling...<br>(snip)<br>2> ..\..\graphics\sjis.cpp<br>2>sjis.cpp<br>(ENABLE_KYRA defined - no errors)<br>2>Linking...<br><br><br>So the *actual* error for this issue is that ENABLE_KYRA is not defined when compiling the kyra engine<br>(inside kyra.vcproj) and it's only defined when compiling the overall solution (inside scummvm.vcproj).<br><br>The reason why we didn't have problems so far is explained by LordHoto as follows:<br><LordHoto> engines typically use:<br><LordHoto> #if PLUGIN_ENABLED_DYNAMIC(KYRA) REGISTER_PLUGIN_DYNAMIC(KYRA, PLUGIN_TYPE_ENGINE, KyraMetaEngine);<br><LordHoto> #else REGISTER_PLUGIN_STATIC(KYRA, PLUGIN_TYPE_ENGINE, KyraMetaEngine);<br><LordHoto> #endif<br><LordHoto> so if ENABLE_KYRA isn't specified and the detection.cpp file is compiled it'll assume it's statically linked<br><LordHoto> thus that's why there's no need for MSVC to include that define in the engine project files so far<br><br>There are two ways to address this issue:<br>1) Add ENABLE_XXX defines in all engine MSVC project files<br>i.e. ENABLE_AGI in agi.vcproj, ENABLE_SAGA in saga.vcproj etc (one define per engine in each engine project file).<br>This means that we'll need to make 2 defines when we want to enable an engine: one in scummvm.vcproj (to <br>include the engines) and one in the engine MSVC project files themselves so that they can use engine-specific<br>common code. This can (and will) get messy and ugly, eventually.<br>2) Add common includes for all engines, thereby greatly simplifying the engine project files, and having everything<br>neatly packed in one common file for all MSVC project files. This solves not only this problem, but many others too,<br>as all compilation options are in one file and not scattered among different ones - this actually makes MSVC<br>compilation options a bit more similar to the GCC ones (i.e. they're all in one place). This solution has been implemented<br>by nolange in the following rejected patch:<br>https://sourceforge.net/tracker/?func=detail&aid=2774908&group_id=37116&atid=418822<br>The main problem with this solution is that it's only supported in MSVC8 and later (as described in the patch tracker<br>item), so we'll have to drop MSVC7 and MSVC7.1 - unless we move to some better system than the batch files I've<br>made right now, i.e. cmake or similar<br><br>Personally, I vote for the second solution: it would be better to drop support for older/strange compilers rather than<br>keeping compile options and defines scattered and duplicated in several files. Also, not a lot of users use MSVC7 and<br>MSVC7.1 (I only know of 1, Quietusk). <br><br>However, I'd like to discuss this before doing anything...<br>Should we drop support for older MSVC compilers and address this properly, or modify all MSVC project files to have<br>an ENABLE_XXX define?<br><br>Regards<br>Filippos<br><br>> CC: scummvm-devel@lists.sourceforge.net<br>> From: max@quendi.de<br>> Date: Wed, 8 Jul 2009 15:33:51 +0200<br>> Subject: Re: [Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[42257] scummvm/trunk/graphics<br>> <br>> <br>> Am 08.07.2009 um 09:13 schrieb thebluegr@users.sourceforge.net:<br>> <br>> > Revision: 42257<br>> > http://scummvm.svn.sourceforge.net/scummvm/? <br>> > rev=42257&view=rev<br>> > Author: thebluegr<br>> > Date: 2009-07-08 07:13:56 +0000 (Wed, 08 Jul 2009)<br>> ><br>> > Log Message:<br>> > -----------<br>> > The ENABLE_* flags are only checked for *.cpp files in MSVC, so move <br>> > the ENABLE_* checks to sjis.cpp to fix compilation under MSVC<br>> ><br>> <br>> I don't understand, what does that mean??? Do you mean to say these <br>> flags are only #defined in the .cpp files? That would be most weird.<br>> <br>> Or maybe MSVC doesn't #define them globally at all but rather relies <br>> on these values being set from config.h -- in that case, the solution <br>> would be to add an #include "common/scummsys.h" at the top of the <br>> header.<br>> <br>> But moving the check from the header file to the source file seems <br>> wrong.<br>> <br>> Cheers,<br>> Max<br>> <br>> <br>> > Modified Paths:<br>> > --------------<br>> > scummvm/trunk/graphics/sjis.cpp<br>> > scummvm/trunk/graphics/sjis.h<br>> ><br>> > Modified: scummvm/trunk/graphics/sjis.cpp<br>> > ===================================================================<br>> > --- scummvm/trunk/graphics/sjis.cpp 2009-07-08 07:11:43 UTC (rev <br>> > 42256)<br>> > +++ scummvm/trunk/graphics/sjis.cpp 2009-07-08 07:13:56 UTC (rev <br>> > 42257)<br>> > @@ -23,11 +23,16 @@<br>> > */<br>> ><br>> > #include "graphics/sjis.h"<br>> > +#include "common/debug.h"<br>> ><br>> > -#ifdef GRAPHICS_SJIS_H<br>> > +// The code in this file is currently only used in KYRA and SCI.<br>> > +// So if neither of those is enabled, we will skip compiling it.<br>> > +// If you plan to use this code in another engine, you will have<br>> > +// to add the proper define check here.<br>> > +// Also please add the define check at the comment after the<br>> > +// matching #endif further down this file.<br>> > +#if defined(ENABLE_KYRA) || defined(ENABLE_SCI)<br>> ><br>> > -#include "common/debug.h"<br>> > -<br>> > namespace Graphics {<br>> ><br>> > bool FontTowns::loadFromStream(Common::ReadStream &stream) {<br>> > @@ -193,5 +198,5 @@<br>> ><br>> > } // end of namespace Graphics<br>> ><br>> > -#endif // defined(GRAPHICS_SJIS_H)<br>> > +#endif // defined(ENABLE_KYRA) || defined(ENABLE_SCI)<br>> ><br>> ><br>> > Modified: scummvm/trunk/graphics/sjis.h<br>> > ===================================================================<br>> > --- scummvm/trunk/graphics/sjis.h 2009-07-08 07:11:43 UTC (rev 42256)<br>> > +++ scummvm/trunk/graphics/sjis.h 2009-07-08 07:13:56 UTC (rev 42257)<br>> > @@ -22,14 +22,6 @@<br>> > * $Id$<br>> > */<br>> ><br>> > -// The code in this file is currently only used in KYRA and SCI.<br>> > -// So if neither of those is enabled, we will skip compiling it.<br>> > -// If you plan to use this code in another engine, you will have<br>> > -// to add the proper define check here.<br>> > -// Also please add the define check at the comment after the<br>> > -// matching #endif further down this file.<br>> > -#if defined(ENABLE_KYRA) || defined(ENABLE_SCI)<br>> > -<br>> > #ifndef GRAPHICS_SJIS_H<br>> > #define GRAPHICS_SJIS_H<br>> ><br>> > @@ -131,5 +123,3 @@<br>> ><br>> > #endif<br>> ><br>> > -#endif // defined(ENABLE_KYRA) || defined(ENABLE_SCI)<br>> > -<br>> ><br>> ><br>> > This was sent by the SourceForge.net collaborative development <br>> > platform, the world's largest Open Source development site.<br>> ><br>> > ------------------------------------------------------------------------------<br>> > Enter the BlackBerry Developer Challenge<br>> > This is your chance to win up to $100,000 in prizes! For a limited <br>> > time,<br>> > vendors submitting new applications to BlackBerry App World(TM) will <br>> > have<br>> > the opportunity to enter the BlackBerry Developer Challenge. See <br>> > full prize<br>> > details at: http://p.sf.net/sfu/Challenge<br>> > _______________________________________________<br>> > Scummvm-cvs-logs mailing list<br>> > Scummvm-cvs-logs@lists.sourceforge.net<br>> > https://lists.sourceforge.net/lists/listinfo/scummvm-cvs-logs<br>> ><br>> <br>> <br>> ------------------------------------------------------------------------------<br>> Enter the BlackBerry Developer Challenge <br>> This is your chance to win up to $100,000 in prizes! For a limited time, <br>> vendors submitting new applications to BlackBerry App World(TM) will have<br>> the opportunity to enter the BlackBerry Developer Challenge. See full prize <br>> details at: http://p.sf.net/sfu/Challenge<br>> _______________________________________________<br>> Scummvm-devel mailing list<br>> Scummvm-devel@lists.sourceforge.net<br>> https://lists.sourceforge.net/lists/listinfo/scummvm-devel<br><br /><hr />Hotmail® has ever-growing storage! Don’t worry about storage limits. <a href='http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009' target='_new'>Check it out.</a></body>
</html>