Open main menu

Difference between revisions of "Compiling ScummVM/Visual Studio/Compiling Libraries"

→‎FLAC: Inlined the FLAC patch into a source code box, as the link to it is down
(→‎libmad: Inlined the libmad patch into a source code box, as the link to it is down)
(→‎FLAC: Inlined the FLAC patch into a source code box, as the link to it is down)
Line 119: Line 119:
Open its solution and compile the libFLAC_static project. By default, optimization for this library is set to "full" in release builds, which will prevent you from performing incremental debug builds later on, so make sure to set it to "Maximize speed" (or anything other than "Full optimization"), otherwise it will be impossible to build incremental debug builds later on. Check the introductory section for more information. Also, FLAC OGGs are not needed, so support for these can be dropped by going to the libFLAC_static project settings and removing the FLAC__HAS_OGG switch from C/C++->Preprocessor->Preprocessor Definitions.
Open its solution and compile the libFLAC_static project. By default, optimization for this library is set to "full" in release builds, which will prevent you from performing incremental debug builds later on, so make sure to set it to "Maximize speed" (or anything other than "Full optimization"), otherwise it will be impossible to build incremental debug builds later on. Check the introductory section for more information. Also, FLAC OGGs are not needed, so support for these can be dropped by going to the libFLAC_static project settings and removing the FLAC__HAS_OGG switch from C/C++->Preprocessor->Preprocessor Definitions.


'''Note for x64''': After converting the Win32 target to x64 you will need to adapt some file settings. First of all you will need to disable all *.nasm files in the "libFLAC_static" project, this can be easily done by right clicking on them and selecting "Properties", now set "Excluded From Build" to "true". Next you will need to adapt the Preprocessor Definitions: First of all remove the following defintions: "FLAC__CPU_IA32", "FLAC__HAS_NASM" and "FLAC__USE_3DNOW", now also add "FLAC__NO_ASM". Last but not least you will need to apply the following patch file to "bitreader.c" of the "libFLAC_static" project: [http://robertmegone.com/scummvm/build/flac.patch flac.patch]
'''Note for x64''': After converting the Win32 target to x64 you will need to adapt some file settings. First of all you will need to disable all *.nasm files in the "libFLAC_static" project, this can be easily done by right clicking on them and selecting "Properties", now set "Excluded From Build" to "true". Next you will need to adapt the Preprocessor Definitions: First of all remove the following defintions: "FLAC__CPU_IA32", "FLAC__HAS_NASM" and "FLAC__USE_3DNOW", now also add "FLAC__NO_ASM". Last but not least you will need to apply the following patch file to "bitreader.c" of the "libFLAC_static" project:
 
<source lang="diff">
--- src/libFLAC/bitreader.c Tue Sep 11 05:48:56 2007
+++ src/libFLAC/bitreader.c Tue Nov 03 19:19:37 2009
@@ -149,13 +149,23 @@
FLAC__CPUInfo cpu_info;
};
-#ifdef _MSC_VER
+#if defined (_MSC_VER)
/* OPT: an MSVC built-in would be better */
static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x)
{
x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
return (x>>16) | (x<<16);
}
+
+#ifdef _WIN64
+static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len)
+{
+ while (len--) {
+ *start = local_swap32_(*start);
+ ++start;
+ }
+}
+#else
static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len)
{
__asm {
@@ -173,6 +183,7 @@
done1:
}
}
+#endif
#endif
static FLaC__INLINE void crc16_update_word_(FLAC__BitReader *br, brword word)
</source>


=== libpng ===
=== libpng ===


Open the solution under projects\vstudio. You also need zlib to compile this library, which must be placed in a folder named "zlib" outside libpng's directory. You need to change the settings of zlib like you have done before (i.e. from "Multi-Threaded DLL (/MD)" to "Multi-Threaded (/MT)"). Check the zlib section for more information.
Open the solution under projects\vstudio. You also need zlib to compile this library, which must be placed in a folder named "zlib" outside libpng's directory. You need to change the settings of zlib like you have done before (i.e. from "Multi-Threaded DLL (/MD)" to "Multi-Threaded (/MT)"). Check the zlib section for more information.
1,489

edits