CREATE_PROJECT: Add a52dec and libmpcdec

This commit is contained in:
SupSuper 2024-10-17 06:38:58 +01:00
parent b234f51dee
commit 92cbe01360
4 changed files with 70 additions and 32 deletions

View File

@ -61,7 +61,9 @@ const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *f
LibraryProps("discord", "discord").Libraries("discord-rpc"),
LibraryProps("tts").WinLibraries("sapi ole32"),
LibraryProps("enet").WinLibraries("winmm ws2_32"),
LibraryProps("retrowave", "retrowave").Libraries("retrowave")
LibraryProps("retrowave", "retrowave").Libraries("retrowave"),
LibraryProps("a52", "a52").Libraries("a52"),
LibraryProps("mpdec", "mpcdec").Libraries("mpcdec")
};
for (unsigned int i = 0; i < sizeof(s_libraries) / sizeof(s_libraries[0]); i++) {

View File

@ -345,8 +345,13 @@ int main(int argc, char *argv[]) {
}
// HACK: Fluidsynth and Fluidlite can not be enabled simultaneously
if (getFeatureBuildState("fluidsynth", setup.features)) {
setFeatureBuildState("fluidlite", setup.features, false);
if (getFeatureBuildState("fluidlite", setup.features)) {
setFeatureBuildState("fluidsynth", setup.features, false);
}
// HACK: OpenMPT and Mikmod can not be enabled simultaneously
if (getFeatureBuildState("openmpt", setup.features)) {
setFeatureBuildState("mikmod", setup.features, false);
}
// HACK: These features depend on OpenGL
@ -1123,6 +1128,8 @@ const Feature s_features[] = {
{ "sdlnet", "USE_SDL_NET", true, true, "SDL_net support" },
{ "discord", "USE_DISCORD", true, false, "Discord support" },
{ "retrowave", "USE_RETROWAVE", true, false, "RetroWave OPL3 support" },
{ "a52", "USE_A52", true, false, "ATSC A/52 support" },
{ "mpcdec", "USE_MPCDEC", true, false, "Musepack support" },
// Feature flags
{ "bink", "USE_BINK", false, true, "Bink video support" },

View File

@ -50,36 +50,39 @@ MSVCProvider::MSVCProvider(StringList &global_warnings, std::map<std::string, St
std::string MSVCProvider::getLibraryFromFeature(const char *feature, const BuildSetup &setup, bool isRelease) const {
static const MSVCLibrary s_libraries[] = {
// Libraries
{ "sdl", "SDL.lib", "SDLd.lib", "winmm.lib imm32.lib version.lib setupapi.lib" },
{ "sdl2", "SDL2.lib", "SDL2d.lib", "winmm.lib imm32.lib version.lib setupapi.lib" },
{ "zlib", "zlib.lib", "zlibd.lib", nullptr },
{ "mad", "mad.lib", nullptr, nullptr },
{ "fribidi", "fribidi.lib", nullptr, nullptr },
{ "ogg", "ogg.lib", nullptr, nullptr },
{ "vorbis", "vorbis.lib vorbisfile.lib", nullptr, nullptr },
{ "flac", "FLAC.lib", nullptr, nullptr },
{ "png", "libpng16.lib", "libpng16d.lib", nullptr },
{ "gif", "gif.lib", nullptr, nullptr },
{ "faad", "faad.lib", nullptr, nullptr },
{ "mikmod", "mikmod.lib", nullptr, nullptr },
{ "openmpt", "openmpt.lib", nullptr, nullptr },
{ "mpeg2", "mpeg2.lib", nullptr, nullptr },
{ "theoradec", "theora.lib", nullptr, nullptr },
{ "vpx", "vpx.lib", nullptr, nullptr },
{ "freetype2", "freetype.lib", "freetyped.lib", nullptr },
{ "jpeg", "jpeg.lib", nullptr, nullptr },
{"fluidsynth", "fluidsynth.lib", nullptr, nullptr },
{ "fluidlite", "fluidlite.lib", nullptr, nullptr },
{ "libcurl", "libcurl.lib", "libcurl-d.lib", "ws2_32.lib wldap32.lib crypt32.lib normaliz.lib" },
{ "sdlnet", "SDL_net.lib", nullptr, "iphlpapi.lib" },
{ "sdl2net", "SDL2_net.lib", nullptr, "iphlpapi.lib" },
{ "discord", "discord-rpc.lib", nullptr, nullptr },
{ "retrowave", "retrowave.lib", nullptr, nullptr },
{ "sdl", "SDL.lib", "SDLd.lib", "winmm.lib imm32.lib version.lib setupapi.lib" },
{ "sdl2", "SDL2.lib", "SDL2d.lib", "winmm.lib imm32.lib version.lib setupapi.lib" },
{ "zlib", "zlib.lib", "zlibd.lib", nullptr },
{ "mad", "mad.lib", nullptr, nullptr },
{ "fribidi", "fribidi.lib", nullptr, nullptr },
{ "ogg", "ogg.lib", nullptr, nullptr },
{ "vorbis", "vorbis.lib vorbisfile.lib", nullptr, nullptr },
{ "tremor", "vorbisidec.lib", nullptr, nullptr },
{ "flac", "FLAC.lib", nullptr, nullptr },
{ "png", "libpng16.lib", "libpng16d.lib", nullptr },
{ "gif", "gif.lib", nullptr, nullptr },
{ "faad", "faad.lib", nullptr, nullptr },
{ "mikmod", "mikmod.lib", nullptr, nullptr },
{ "openmpt", "openmpt.lib", nullptr, nullptr },
{ "mpeg2", "mpeg2.lib", nullptr, nullptr },
{ "theoradec", "theora.lib", nullptr, nullptr },
{ "vpx", "vpx.lib", nullptr, nullptr },
{ "freetype2", "freetype.lib", "freetyped.lib", nullptr },
{ "jpeg", "jpeg.lib", nullptr, nullptr },
{"fluidsynth", "fluidsynth.lib", nullptr, nullptr },
{ "fluidlite", "fluidlite.lib", nullptr, nullptr },
{ "libcurl", "libcurl.lib", "libcurl-d.lib", "ws2_32.lib wldap32.lib crypt32.lib normaliz.lib" },
{ "sdlnet", "SDL_net.lib", nullptr, "iphlpapi.lib" },
{ "sdl2net", "SDL2_net.lib", "SDL2_netd.lib", "iphlpapi.lib" },
{ "discord", "discord-rpc.lib", nullptr, nullptr },
{ "retrowave", "RetroWave.lib", nullptr, nullptr },
{ "a52", "a52.lib", nullptr, nullptr },
{ "mpcdec", "libmpcdec.lib", "libmpcdec_d.lib", nullptr },
// Feature flags with library dependencies
{ "updates", "winsparkle.lib", nullptr, nullptr },
{ "tts", nullptr, nullptr, "sapi.lib" },
{ "opengl", nullptr, nullptr, nullptr },
{ "enet", nullptr, nullptr, "winmm.lib ws2_32.lib" }
{ "updates", "WinSparkle.lib", nullptr, nullptr },
{ "tts", nullptr, nullptr, "sapi.lib" },
{ "opengl", nullptr, nullptr, nullptr },
{ "enet", nullptr, nullptr, "winmm.lib ws2_32.lib" }
};
// HACK for switching SDL_net to SDL2_net

View File

@ -588,6 +588,14 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
if (CONTAINS_DEFINE(setup.defines, "USE_DISCORD")) {
DEF_LOCALLIB_STATIC("libdiscord-rpc");
}
if (CONTAINS_DEFINE(setup.defines, "USE_A52")) {
DEF_LOCALLIB_STATIC("liba52");
DEF_LOCALXCFRAMEWORK("a52", projectOutputDirectory);
}
if (CONTAINS_DEFINE(setup.defines, "USE_MPCDEC")) {
DEF_LOCALLIB_STATIC("libmpcdec");
DEF_LOCALXCFRAMEWORK("mpcdec", projectOutputDirectory);
}
if (setup.useSDL2) {
DEF_LOCALLIB_STATIC("libSDL2main");
@ -686,6 +694,12 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
if (CONTAINS_DEFINE(setup.defines, "USE_FRIBIDI")) {
frameworks_iOS.push_back(getLibString("fribidi", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_A52")) {
frameworks_iOS.push_back(getLibString("a52", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_MPCDEC")) {
frameworks_iOS.push_back(getLibString("mpcdec", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDSYNTH") &&
!CONTAINS_DEFINE(setup.defines, "USE_FLUIDLITE")) {
frameworks_iOS.push_back(getLibString("fluidsynth", setup.useXCFramework));
@ -820,6 +834,12 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
if (CONTAINS_DEFINE(setup.defines, "USE_DISCORD")) {
frameworks_osx.push_back(getLibString("discord-rpc", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_A52")) {
frameworks_osx.push_back(getLibString("a52", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_MPCDEC")) {
frameworks_osx.push_back(getLibString("mpcdec", setup.useXCFramework));
}
if (setup.useSDL2) {
frameworks_osx.push_back(getLibString("SDL2main", setup.useXCFramework));
@ -920,6 +940,12 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
if (CONTAINS_DEFINE(setup.defines, "USE_FRIBIDI")) {
frameworks_tvOS.push_back(getLibString("fribidi", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_A52")) {
frameworks_tvOS.push_back(getLibString("a52", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_MPCDEC")) {
frameworks_tvOS.push_back(getLibString("mpcdec", setup.useXCFramework));
}
if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDSYNTH") &&
!CONTAINS_DEFINE(setup.defines, "USE_FLUIDLITE")) {
frameworks_tvOS.push_back(getLibString("fluidsynth", setup.useXCFramework));