using Sharpmake; using System.IO; namespace JustDance.Engine { #region Engine Extern Base Classes [Generate] public abstract class EngineExternProject : BaseCppProject { public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.Options.Remove(Options.Vc.General.TreatWarningsAsErrors.Enable); conf.Options.Add(Options.Vc.General.TreatWarningsAsErrors.Disable); conf.If(Platform.orbis | Platform.nx).AdditionalCompilerOptions.Add(" -w"); } } [Generate] public class EngineExternSolution : BaseCppSolution { public EngineExternSolution() { Name = "Extern"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.RegisterProjectsOfType(target); } } #endregion #region Script [Generate] internal class LuaLib : EngineExternProject { public LuaLib() { RootPath = ExternPath + "lua"; SourceRootPath = RootPath + "/src"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Script"; conf.SourceFilesBuildExclude.Add("luac.c"); conf.SourceFilesBuildExclude.Add("lua.c"); conf.SourceFilesBuildExclude.Add("print.c"); conf.IfNot(Platform.win32 | Platform.win64).SourceFilesBuildExclude.Add("loadlib.c"); //exclude these files because they are not used and prevent unit tests from compiling conf.If(Platform.orbis).SourceFilesBuildExclude.Add("linit.c"); conf.If(Platform.orbis).SourceFilesBuildExclude.Add("liolib.c"); conf.If(Platform.orbis).SourceFilesBuildExclude.Add("loslib.c"); //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } [Generate] internal class LuaInterpreter : EngineExternProject { public LuaInterpreter() { RootPath = ExternPath + "lua"; SourceRootPath = RootPath + "/src"; SourceFilesFiltersRegex.Add("lua.c"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Script"; } } #endregion #region Serialization [Generate] internal class PugiXml : EngineExternProject { public PugiXml() { RootPath = ExternPath + "pugixml"; SourceRootPath = RootPath + "/src"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Serialization"; } } [Generate] internal class TinyXml : EngineExternProject { public TinyXml() { RootPath = ExternPath + "tinyxml"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Serialization"; conf.IncludePaths.Add(SourcePath); } } #endregion #region Compression [Generate] internal class ZLib : EngineExternProject { public ZLib() { RootPath = ExternPath + "ZLib"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Compression"; conf.SourceFilesBuildExclude.Add("example.c", "minigzip.c"); //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } #endregion #region Image [Generate] internal class CaptureJpeg : EngineExternProject { public CaptureJpeg() { RootPath = ExternPath + "CaptureJpeg"; SourceRootPath = RootPath + "/Source"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; if (conf.Platform.IsIn(Platform.durango | Platform.orbis)) { conf.Defines.Add("NO_GETENV"); } //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } [Generate] internal class LibPng : EngineExternProject { public LibPng() { RootPath = ExternPath + "libpng"; SourceRootPath = RootPath + "/custom"; SourceFilesExcludeRegex.Add(@"contrib\\", @"projects\\", @"scripts\\"); SourceFilesExclude.Add("example.c", "pngtest.c"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; conf.AddPrivateDependency(target); //We need to have this include on first position because of conflict with Zlib from SDK, on these platforms: conf.If(Platform.nx).IncludePrivatePaths.Add(ExternPath + "/ZLib"); //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } [Generate] internal class LibTiff : EngineExternProject { public LibTiff() { RootPath = ExternPath + "/FreeImage/Source/LibTiff"; SourceFilesExclude.Add( "tif_acorn.c", "tif_apple.c", "tif_atari.c", "tif_unix.c", "tif_vms.c", "tif_wince.c", "tif_msdos.c", "tif_win3.c", "tif_win32.c", "mkg3states.c", "mkspans.c"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } [Generate] internal class LibJpeg : EngineExternProject { public LibJpeg() { RootPath = ExternPath + "/FreeImage/Source/LibJPEG"; SourceFilesFiltersRegex.Add( "jaricom.c", "jcapimin.c", "jcapistd.c", "jcarith.c", "jccoefct.c", "jccolor.c", "jcdctmgr.c", "jchuff.c", "jcinit.c", "jcmainct.c", "jcmarker.c", "jcmaster.c", "jcomapi.c", "jcparam.c", "jcprepct.c", "jcsample.c", "jctrans.c", "jdapimin.c", "jdapistd.c", "jdarith.c", "jdatadst.c", "jdatasrc.c", "jdcoefct.c", "jdcolor.c", "jddctmgr.c", "jdhuff.c", "jdinput.c", "jdmainct.c", "jdmarker.c", "jdmaster.c", "jdmerge.c", "jdpostct.c", "jdsample.c", "jdtrans.c", "jerror.c", "jfdctflt.c", "jfdctfst.c", "jfdctint.c", "jidctflt.c", "jidctfst.c", "jidctint.c", "jmemmgr.c", "jmemnobs.c", "jquant1.c", "jquant2.c", "jutils.c", "transupp.c"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; } } [Generate] internal class LibMng : EngineExternProject { public LibMng() { RootPath = ExternPath + "/FreeImage/Source/LibMNG"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; conf.Defines.Add("MNG_BUILD_SO"); conf.AddPrivateDependency(target); } } [Generate] internal class OpenJpeg : EngineExternProject { public OpenJpeg() { RootPath = ExternPath + "/FreeImage/Source/LibOpenJPEG"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; conf.Defines.Add("OPJ_STATIC"); } } [Generate] internal class RawLite : EngineExternProject { public RawLite() { RootPath = ExternPath + "/FreeImage/Source/LibRawLite"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; conf.Defines.Add("LIBRAW_NODLL", "LIBRAW_LIBRARY_BUILD", "NO_LCMS"); } } [Generate] internal class OpenExr : EngineExternProject { public OpenExr() { RootPath = ExternPath + "/FreeImage/Source/OpenEXR"; SourceFilesExcludeRegex.Add(@"\\Half\\eLut.cpp", @"\\Half\\toFloat.cpp", @"\\IlmThread\\IlmThreadMutexPosix.cpp", @"\\IlmThread\\IlmThreadMutexWin32.cpp", @"\\IlmThread\\IlmThreadSemaphorePosix.cpp", @"\\IlmThread\\IlmThreadSemaphoreWin32.cpp", @"\\IlmThread\\IlmThreadPosix.cpp", @"\\IlmThread\\IlmThreadSemaphorePosixCompat.cpp", @"\\IlmThread\\IlmThreadWin32.cpp", @"\\IlmThread\\IlmThreadWin32.cpp", @"\\IlmImf\\b44ExpLogTable.cpp", @"\\Imath\\ImathShear.cpp", @"\\Imath\\ImathBox.cpp"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; conf.AddPrivateDependency(target); conf.IncludePaths.Add( RootPath + "/IlmImf", RootPath + "/Iex", RootPath + "/Half", RootPath + "/Imath", RootPath + "/IlmThread"); } } [Generate] internal class FreeImage : EngineExternProject { public FreeImage() { RootPath = ExternPath + "freeimage"; SourceRootPath = RootPath + "/Source"; SourceFilesExcludeRegex.Add("FreeImageLib", "LibJPEG", "LibMNG", "LibOpenJPEG", "LibPNG", "LibRawLite", "LibTIFF", "OpenEXR", "ZLib"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Image"; conf.AddPrivateDependency(target); conf.AddPrivateDependency(target); conf.AddPrivateDependency(target); conf.AddPrivateDependency(target); if (conf.Platform.IsIn(Platform.win32 | Platform.win64 | Platform.durango | Platform.orbis)) { conf.SourceFilesBuildExcludeRegex.Add( @"FreeImage\\J2KHelper.cpp", @"FreeImage\\PluginRAW.cpp", @"FreeImage\\PluginEXR.cpp", @"FreeImage\\PluginJ2K.cpp", @"FreeImage\\PluginJP2.cpp", @"FreeImage\\PluginHDR.cpp", @"FreeImage\\PluginKOALA.cpp", @"FreeImage\\PluginWBMP.cpp", @"FreeImage\\PluginXBM.cpp", @"FreeImage\\PluginRAS.cpp", @"FreeImage\\PluginPNG.cpp", @"FreeImage\\PluginPNM.cpp", @"FreeImage\\PluginPSD.cpp", @"FreeImage\\PluginSGI.cpp", @"FreeImage\\tmoFattal02.cpp", @"FreeImage\\PluginXPM.cpp", @"FreeImage\\PSDParser.cpp"); } conf.IncludePrivatePaths.Add( SourceRootPath + "/DeprecationManager", SourceRootPath + "/OpenEXR", SourceRootPath + "/ZLib", SourceRootPath + "/OpenEXR/IlmImf", SourceRootPath + "/OpenEXR/Iex", SourceRootPath + "/OpenEXR/Half", SourceRootPath + "/OpenEXR/Imath", SourceRootPath + "/OpenEXR/IlmThread" ); conf.Defines.Add("OPJ_STATIC", "FREEIMAGE_LIB", "ITF_FREEIMAGE"); if (!conf.Platform.IsWindows()) { conf.Defines.Add("NO_GETENV"); } //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } #endregion #region Audio [Generate] internal class LibOgg : EngineExternProject { public LibOgg() { RootPath = ExternPath + "libogg"; SourceRootPath = RootPath + "/custom"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Audio"; conf.IncludePaths.Add(SourceRootPath + "/include"); //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } [Generate] internal class LibVorbis : EngineExternProject { public LibVorbis() { RootPath = ExternPath + "libvorbis"; SourceRootPath = RootPath + "/custom"; SourceFilesFiltersRegex.Add(@"custom\\lib"); SourceFilesFiltersRegex.Add(@"custom\\include"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Audio"; conf.IncludePaths.Add(SourceRootPath + "/include", SourceRootPath + "/lib"); conf.AddPrivateDependency(target); conf.SourceFilesBuildExcludeRegex.Add("tone.c", "psytune.c", "vorbisfile.c", "barkmel.c", "sharebook.c"); //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } [Generate] internal class Raki : EngineExternProject { public Raki() { RootPath = ExternPath + @"Raki"; SourceRootPath = ExternPath + @"Raki/Source/RakiEngine"; //PrecompileHeader = "Precompiled"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Audio"; if (target.IsPcStandalone()) { conf.IncludePaths.Clear(); conf.IncludePaths.Add(@"$(DXSDK_DIR)\Include", @"$(DXSDK_DIR)\Extras\DirectShow\Include", @"$(WindowsSdkDir)\common\include", ExternPath + "UplaySDK/include"); } conf.IncludePaths.Add(ExternPath + @"Raki/Source"); if (conf.Platform.IsIn(Platform.orbis | Platform.nx)) { conf.SourceFilesBuildExclude.Add("Engine/_XAudio2/EngineNative_XAudio2.cpp", "Routing/_XAudio2/AuxManagerNative_XAudio2.cpp", "Routing/_XAudio2/AuxNative_XAudio2.cpp", "Routing/_XAudio2/ReverbNative_XAudio2.cpp", "Sounds/_XAudio2/BufferSoundNative.cpp", "Sounds/_XAudio2/PCMStreamSoundNative.cpp", "Sounds/_XAudio2/SoundNative_XAudio2.cpp", "Sounds/_XAudio2/StreamSoundNative.cpp"); } conf.If(Optimization.Debug).Defines.Add("RAKI_TARGET_DEBUG"); conf.If(Optimization.Release).Defines.Add("RAKI_TARGET_RELEASE"); conf.If(Optimization.Retail).Defines.Add("RAKI_TARGET_FINAL"); conf.SourceFilesBuildExcludeRegex.Add("_XB360"); conf.SourceFilesBuildExcludeRegex.Add("_wii"); if (conf.Platform.IsWindows()) conf.Defines.Add("RAKI_PLATFORM_WIN32"); if (conf.Platform == Platform.orbis) conf.Defines.Add("RAKI_PLATFORM_ORBIS"); if (conf.Platform == Platform.durango) conf.Defines.Add("RAKI_PLATFORM_DURANGO"); if (conf.Platform == Platform.nx) conf.Defines.Add("RAKI_PLATFORM_NX"); } } [Generate] internal class GoTop : EngineExternProject { public GoTop() { RootPath = ExternPath + @"GoTop"; SourceRootPath = ExternPath + @"GoTop/sources/"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Security"; conf.IncludePaths.Add(ExternPath + @"GoTop/sources/"); conf.IfNot(Platform.win32 | Platform.win64).SourceFilesBuildExcludeRegex.Add(".cpp"); } } [Generate] internal class Soundwich : EngineExternProject { public Soundwich() { RootPath = ExternPath + @"Soundwich/Solution/Engine/Src"; SourceRootPath = ExternPath + @"Soundwich/Solution/Engine/Src"; AdditionalSourceRootPaths.Add( ExternPath + @"Soundwich/Solution/Engine/Inc" ); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Audio"; conf.IncludePaths.Add(ExternPath + @"Soundwich/Solution/Engine/Src"); conf.IncludePaths.Add(ExternPath + @"Soundwich/Solution/Engine"); } } #endregion #region Video [Generate] internal class LibVpx : EngineExternProject { public LibVpx() { RootPath = ExternPath + "libvpx"; SourceRootPath = RootPath + "/custom"; SourceFilesFiltersRegex.Add(@"build\\generic-gnu", @"\\vpx\\", @"\\vp8\\", @"\\vpx_mem\\", @"\\vpx_ports\\", @"\\vpx_scale\\"); SourceFilesExcludeRegex.Add( @"\\vp8\\common\\mips", @"\\vp8\\common\\wii", @"\\vp8\\decoder\\arm", @"\\vp8\\decoder\\ps3\\SPU", @"\\vp8\\encoder\\arm\\", @"\\vp8\\encoder\\ssim.c", @"\\vpx_ports\\arm", @"\\vpx_scale\\arm\\", @"\\vpx_scale\\win32\\", @"\\vpx_scale\\generic\\bicubic_scaler.c", @"\\ppc\\" ); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Video"; conf.IncludePaths.Add(SourceRootPath + "/build/generic-gnu"); if (!conf.Platform.IsWindows() || conf.Platform == Platform.win64) { conf.SourceFilesBuildExcludeRegex.Add("x86"); conf.SourceFilesBuildExcludeRegex.Add(@"\.asm$"); } if (conf.Platform != Platform.nx) { conf.SourceFilesBuildExcludeRegex.Add(@"\\vp8\\common\\arm"); } conf.If(Platform.win32).Defines.Add("ARCH_X86"); conf.If(Platform.orbis).Defines.Add("ORBIS"); conf.If(Platform.durango).Defines.Add("DURANGO"); // conf.If(Scarlett.SharpmakePlatform).Defines.Add("SCARLETT"); if (conf.Platform.IsIn(Platform.orbis | Platform.win64 | Platform.durango)) { conf.SourceFilesBuildExclude.Add(SourceRootPath + "/vpx_ports/x86_cpuid.c"); } if (conf.Platform.IsIn(Platform.durango)) { conf.SourceFilesBuildExcludeRegex.Remove(string.Format(@"\\{0}\\", "WIN32")); // in VPX, the files in the directory "win32" are actually good for all MS platforms } //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); if(conf.Platform.IsIn(Platform.orbis | Platform.nx)) { conf.AdditionalCompilerOptions.Add("-Wno-unused-function"); } } } [Generate] internal class LibWebm : EngineExternProject { public LibWebm() { RootPath = ExternPath + "libwebm"; SourceRootPath = RootPath + "/custom"; SourceFilesExcludeRegex.Add(@"\\sample"); SourceFilesExcludeRegex.Add(@".cc"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Video"; conf.IncludePaths.Add(ExternPath + "/Profiler"); //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } [Generate] internal class Pleo : EngineExternProject { public Pleo() { RootPath = ExternPath + @"Pleo"; SourceRootPath = ExternPath + "Pleo/Pleo/src"; PrecompileHeader = "VP_PrecompiledHeader"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Video"; conf.AddExternDependency(target); conf.AddExternDependency(target); conf.AddExternDependency(target); conf.AddExternDependency(target); conf.IncludePaths.Add(ExternPath + "Pleo/Pleo/src", ExternPath + "Pleo/Pleo/src/public", ExternPath + "Pleo/Pleo/src/private"); if (conf.Platform == Platform.orbis) { conf.Defines.Add("ORBIS"); conf.IfNot(Optimization.Retail).Defines.Add("PLEO_PROFILER_ON"); } } } [Generate] internal class PleoExt : EngineExternProject { public PleoExt() { RootPath = ExternPath + @"Pleo"; SourceRootPath = ExternPath + "Pleo/PleoEXT/src"; SourceFilesBuildExcludeRegex.Add("linux"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); if (!conf.Platform.IsWindows()) { conf.SourceFilesBuildExcludeRegex.Add(".cpp"); } conf.SolutionFolder = "Extern/Video"; conf.AddExternDependency(target); conf.AddExternDependency(target); conf.AddExternDependency(target); } } [Generate] internal class PleoNet : EngineExternProject { public static string DllPath = OutputPath + @"lib\PleoNet.dll"; public PleoNet() { OutputType = Configuration.OutputType.DotNetClassLibrary; RootPath = ExternPath + @"Pleo"; SourceRootPath = ExternPath + "Pleo/Pleo.NET"; SourceFilesBuildExcludeRegex.Add("linux"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); if (!conf.Platform.IsWindows()) { conf.SourceFilesBuildExcludeRegex.Add(".cpp"); } conf.SolutionFolder = "Extern/Video"; conf.TargetPath = OutputPath + @"\lib\"; conf.TargetFileName = "PleoNet" + (target.Platform == Platform.win32 ? "32" : ""); conf.AdditionalLinkerOptions.Add("/ignore:4248"); } protected override void ConfigureLinkerOptions(Configuration conf, BaseCppTarget target) { base.ConfigureLinkerOptions(conf, target); conf.LibraryFiles.Add("winmm.lib"); conf.ReferencesByName.Add("System", "System.Core", "System.Data", "System.Drawing", "System.Windows.Forms", "WindowsBase"); conf.Options.Add(Options.Vc.Linker.GenerateMapFile.Disable); conf.AdditionalLinkerOptions.Remove("/WX"); conf.AddExternDependency(target); conf.AddExternDependency(target); conf.AddExternDependency(target); conf.AddExternDependency(target); } protected override void ConfigureCompilerOptions(Configuration conf, BaseCppTarget target) { conf.Options.Add(Options.Vc.General.CommonLanguageRuntimeSupport.ClrSupport); conf.Options.Add(Options.Vc.General.CharacterSet.Unicode); conf.Options.Add(Options.Vc.Compiler.RTTI.Disable); conf.Options.Add(Options.Vc.Compiler.Exceptions.EnableWithSEH); conf.Options.Add(Options.Vc.Compiler.RuntimeChecks.Default); conf.Options.Add(Options.Vc.Compiler.FloatingPointModel.Precise); conf.Options.Add(Options.Vc.Compiler.MinimalRebuild.Disable); conf.Options.Add(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.TreatWarningsAsErrors.Disable); conf.Options.Add(Options.Vc.General.WholeProgramOptimization.Disable); if (target.Optimization == Optimization.Debug) conf.Options.Add(Options.Vc.Compiler.Optimization.Disable); else if (target.Optimization == Optimization.Release) conf.Options.Add(Options.Vc.Compiler.Optimization.MaximizeSpeed); conf.Options.Add(Options.Vc.Compiler.Inline.Default); conf.Options.Add(Options.Vc.Compiler.Intrinsic.Disable); conf.Options.Add(Options.Vc.Compiler.FavorSizeOrSpeed.Neither); conf.Options.Add(Options.Vc.Compiler.OmitFramePointers.Disable); conf.Options.Add(Options.Vc.Compiler.FiberSafe.Disable); conf.If(Optimization.Debug).Options.Add(Options.Vc.Compiler.RuntimeLibrary.MultiThreadedDebugDLL); conf.IfNot(Optimization.Debug).Options.Add(Options.Vc.Compiler.RuntimeLibrary.MultiThreadedDLL); } } #endregion #region Network [Generate] internal class Mongoose : EngineExternProject { public Mongoose() { RootPath = ExternPath + "mongoose"; SourceRootPath = RootPath + "/custom"; SourceFilesExcludeRegex.Add(@"examples", @"test"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Network"; conf.IncludePaths.Add(SourceRootPath); if (conf.Platform == Platform.nx) { // not Using ubiservices openssl anymore, starting from NX SDK 11.2.0 } else if (conf.Platform == Platform.durango) { conf.IncludePaths.Add(ExternPath + @"/openssl_x1/custom/include"); } else if (conf.Platform == Platform.orbis) { conf.IncludePaths.Add(ExternPath + @"UbiServices/custom/external/harbourcommon/libraries/openssl_deprecated/include"); } else { conf.IncludePaths.Add(ExternPath + @"/UbiServices/custom/external/harbourcommon/libraries/openssl/include"); } conf.Defines.Add("MONGOOSE_NO_FILESYSTEM", "MONGOOSE_NO_USER", "MONGOOSE_NO_THREADS", "MONGOOSE_NO_CGI", "MONGOOSE_NO_MMAP", "NS_DISABLE_THREADS", "NS_ENABLE_SSL"); //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); if (target.Platform == Platform.durango || target.Platform == Platform.win32 || target.Platform == Platform.win64) { conf.AdditionalCompilerOptions.Add("/TC"); // compile as C for MSVC } } } #endregion #region Database [Generate] internal class Sqlite : EngineExternProject { public Sqlite() { RootPath = ExternPath + "sqlite"; SourceRootPath = RootPath + "/src"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Database"; } } #endregion #region Misc [Generate] internal class Bloomberg : EngineExternProject { public Bloomberg() { RootPath = ExternPath + "bloomberg"; SourceRootPath = RootPath + "/src"; SourceFilesExcludeRegex.Add(@"\\blob\\"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); if (target.Platform == Platform.orbis) { // Bloomberg needs these optimizations disabled irrespective of the config. conf.AdditionalCompilerOptions.Add("-fno-omit-frame-pointer", "-mno-omit-leaf-frame-pointer"); } else if (target.Platform == Platform.durango) { conf.Options.Add(Options.Vc.Compiler.CompileAsWinRT.Enable); conf.Options.Add(Options.Vc.Linker.UseLibraryDependencyInputs.Enable); conf.ConsumeWinRTExtensions.Add("Live"); } conf.SolutionFolder = "Extern/Misc"; conf.IncludePaths.Add(RootPath + "/inc"); if (!conf.Platform.IsWindows()) { conf.SourceFilesBuildExcludeRegex.Add(@"\\symbol\\ms\\"); } if (!conf.Platform.IsMicrosoft()) { conf.SourceFilesBuildExcludeRegex.Add(@"\\ms\\"); } if (conf.Platform.IsWindows()) { conf.Defines.Add("WIN32_LEAN_AND_MEAN"); } if (conf.Platform.IsIn(Platform.durango | Platform.orbis)) { conf.Defines.Add("NO_GETENV"); } string vsVersion = target.DevEnv == DevEnv.vs2012 ? "vs11" : "vs14"; if (conf.Platform.IsIn(Platform.orbis)) { conf.LibraryPaths.Add(ExternPath + "gear4/libs/gear_core/orbis"); conf.LibraryPaths.Add(ExternPath + "gear4/libs/simpleEAL/orbis"); conf.If(Optimization.Debug).LibraryFiles.Add( "liborbis_" + vsVersion + "_gear_core_d.a", "liborbis_" + vsVersion + "_simpleEAL_d.a"); conf.If(Optimization.Release).LibraryFiles.Add("liborbis_" + vsVersion + "_gear_core_r.a", "liborbis_" + vsVersion + "_simpleEAL_r.a"); conf.If(Optimization.Retail).LibraryFiles.Add( "liborbis_" + vsVersion + "_gear_core_f.a", "liborbis_" + vsVersion + "_simpleEAL_f.a"); } else if (conf.Platform.IsIn(Platform.durango)) { conf.LibraryPaths.Add(ExternPath + "gear4/libs/gear_core/durango"); conf.LibraryPaths.Add(ExternPath + "gear4/libs/simpleEAL/durango"); conf.If(Optimization.Debug).LibraryFiles.Add( "durango_" + vsVersion + "_gear_core_d.lib", "durango_" + vsVersion + "_SimpleEAL_d.lib"); conf.If(Optimization.Release).LibraryFiles.Add("durango_" + vsVersion + "_gear_core_r.lib", "durango_" + vsVersion + "_SimpleEAL_r.lib"); conf.If(Optimization.Retail).LibraryFiles.Add( "durango_" + vsVersion + "_gear_core_f.lib", "durango_" + vsVersion + "_SimpleEAL_f.lib"); } else if (conf.Platform.IsIn(Platform.win32 | Platform.win64)) { string arch = conf.Platform == Platform.win64 ? "win64" : "win32"; conf.LibraryPaths.Add(ExternPath + "gear4/libs/gear_core/" + arch); conf.LibraryPaths.Add(ExternPath + "gear4/libs/simpleEAL/" + arch); conf.If(Optimization.Debug).LibraryFiles.Add(arch + "_" + vsVersion + "_gear_core_d.lib", arch + "_" + vsVersion + "_simpleEAL_d.lib"); conf.If(Optimization.Release).LibraryFiles.Add(arch + "_" + vsVersion + "_gear_core_r.lib", arch + "_" + vsVersion + "_simpleEAL_r.lib"); conf.If(Optimization.Retail).LibraryFiles.Add(arch + "_" + vsVersion + "_gear_core_f.lib", arch + "_" + vsVersion + "_simpleEAL_f.lib"); } conf.IncludePaths.Add(ExternPath + "/gear4"); conf.IncludePaths.Add(ExternPath + "/gear4/eal/sources"); //excude all cpp file of bloomberg for NX since it isn't compatible if(conf.Platform.IsIn(Platform.nx)) { conf.SourceFilesBuildExcludeRegex.Add(@".cpp"); } //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); conf.If(!conf.Platform.IsUsingClang()).Options.Add(Options.Vc.Compiler.DefineCPlusPlus.Default); } } [Generate] internal class Pcre : EngineExternProject { public Pcre() { RootPath = ExternPath + "pcre"; SourceFilesFiltersRegex.Add("pcre_chartables.c", "pcre_compile.c", "pcre_config.c", "pcre_dfa_exec.c", "pcre_exec.c", "pcre_fullinfo.c", "pcre_get.c", "pcre_globals.c", "pcre_info.c", "pcre_maketables.c", "pcre_newline.c", "pcre_ord2utf8.c", "pcre_refcount.c", "pcre_study.c", "pcre_tables.c", "pcre_try_flipped.c", "pcre_ucd.c", "pcre_valid_utf8.c", "pcre_version.c", "pcre_xclass.c"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Misc"; conf.Defines.Add("HAVE_CONFIG_H"); } } [Generate] internal class MoveSpace : EngineExternProject { public MoveSpace() { RootPath = ExternPath + "MoveSpace"; SourceRootPath = RootPath + "/src"; SourceFilesExcludeRegex.Add(".cs"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Misc"; conf.IncludePaths.Add(RootPath + "/Includes"); conf.IncludePaths.Add(RootPath); } } [Generate] internal class Scry : EngineExternProject { public Scry() { RootPath = ExternPath + "Scry"; SourceRootPath = RootPath + "/Sources"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Misc"; conf.IncludePaths.Add(RootPath); } } #endregion #region Test [Generate] internal class gmock : EngineExternProject { public gmock() { // As gmock has its own blob, only add these blob files in the projet RootPath = ExternPath + "gmock"; ResourceFilesExtensions.Clear(); SourceFilesExtensions.Clear(); SourceRootPath = RootPath; SourceFiles.Add("googlemock/src/gmock-all.cc"); SourceFiles.Add("googletest/src/gtest-all.cc"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Test"; conf.IncludePaths.Add(ExternPath + "gmock/googlemock/include"); conf.IncludePaths.Add(ExternPath + "gmock/googlemock"); conf.IncludePaths.Add(ExternPath + "gmock/googletest/include"); conf.IncludePaths.Add(ExternPath + "gmock/googletest"); } } #endregion #region Hardware [Generate] internal class WiiYourself : EngineExternProject { public WiiYourself() { RootPath = ExternPath + "WiiYourself_1.15"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Hardware"; conf.IncludePaths.Add(RootPath + "/miniDDK"); foreach (var wiiSuffix in Platform.wii.PathSuffixes(target)) { conf.SourceFilesBuildExcludeRegex.Remove(wiiSuffix); } //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } #endregion #region Graphics [Generate] internal class Squish : EngineExternProject { public Squish() { RootPath = ExternPath + "squish"; SourceFilesExcludeRegex.Add("extra"); } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Graphics"; //We don't want any warnings for this project conf.Options.Remove(Options.Vc.General.WarningLevel.Level3); conf.Options.Add(Options.Vc.General.WarningLevel.Level0); } } #endregion #region Online [Generate] internal class UmpLoader : EngineExternProject { public UmpLoader() { RootPath = ExternPath + "UmpLoader"; } public override void ConfigureAll(Configuration conf, BaseCppTarget target) { base.ConfigureAll(conf, target); conf.SolutionFolder = "Extern/Online"; conf.IncludePaths.Add(RootPath + "/include"); conf.Defines.Add("UMP_X64"); } } #endregion }