Permalink
Browse files

CREATE_PROJECT: Support building with Tremor instead of Vorbis

  • Loading branch information...
ccawley2011 authored and digitall committed Nov 3, 2018
1 parent e016efc commit 8fa2f90a2638f9d635cc2e1e55093e671734274c
@@ -90,10 +90,6 @@ namespace std
#define DISABLE_COMMAND_LINE
#define USE_RGB_COLOR

#if defined(USE_TREMOR) && !defined(USE_VORBIS)
#define USE_VORBIS // make sure this one is defined together with USE_TREMOR!
#endif

// hack in some tricks to work around not having these fcns for Symbian
// and we _really_ don't wanna link with any other windows LIBC library!
#if defined(__GCC32__)
@@ -343,6 +343,9 @@

#endif

#if defined(USE_TREMOR) && !defined(USE_VORBIS)
#define USE_VORBIS // make sure this one is defined together with USE_TREMOR!
#endif

//
// Fallbacks / default values for various special macros
@@ -45,7 +45,9 @@ const CMakeProvider::Library *CMakeProvider::getLibraryFromFeature(const char *f
{ "mpeg2", kSDLVersionAny, "FindMPEG2", "MPEG2", "MPEG2_INCLUDE_DIRS", "MPEG2_mpeg2_LIBRARY", 0 },
{ "flac", kSDLVersionAny, 0, 0, 0, 0, "FLAC" },
{ "mad", kSDLVersionAny, 0, 0, 0, 0, "mad" },
{ "vorbis", kSDLVersionAny, 0, 0, 0, 0, "vorbisfile vorbis ogg" },
{ "ogg", kSDLVersionAny, 0, 0, 0, 0, "ogg" },
{ "vorbis", kSDLVersionAny, 0, 0, 0, 0, "vorbisfile vorbis" },
{ "tremor", kSDLVersionAny, 0, 0, 0, 0, "vorbisidec" },
{ "theora", kSDLVersionAny, 0, 0, 0, 0, "theoradec" },
{ "fluidsynth",kSDLVersionAny, 0, 0, 0, 0, "fluidsynth" },
{ "faad", kSDLVersionAny, 0, 0, 0, 0, "faad" },
@@ -314,6 +314,11 @@ int main(int argc, char *argv[]) {
}
}

// HACK: Vorbis and Tremor can not be enabled simultaneously
if (getFeatureBuildState("tremor", setup.features)) {
setFeatureBuildState("vorbis", setup.features, false);
}

// Print status
cout << "Enabled engines:\n\n";
for (EngineDescList::const_iterator i = setup.engines.begin(); i != setup.engines.end(); ++i) {
@@ -1027,7 +1032,9 @@ const Feature s_features[] = {
// Libraries
{ "libz", "USE_ZLIB", "zlib", true, "zlib (compression) support" },
{ "mad", "USE_MAD", "libmad", true, "libmad (MP3) support" },
{ "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", true, "Ogg Vorbis support" },
{ "ogg", "USE_OGG", "libogg_static", true, "Ogg support" },
{ "vorbis", "USE_VORBIS", "libvorbisfile_static libvorbis_static", true, "Vorbis support" },
{ "tremor", "USE_TREMOR", "libtremor", false, "Tremor support" },
{ "flac", "USE_FLAC", "libFLAC_static win_utf8_io_static", true, "FLAC support" },
{ "png", "USE_PNG", "libpng16", true, "libpng support" },
{ "faad", "USE_FAAD", "libfaad", false, "AAC support" },
@@ -1120,6 +1127,15 @@ bool setFeatureBuildState(const std::string &name, FeatureList &features, bool e
}
}

bool getFeatureBuildState(const std::string &name, FeatureList &features) {
FeatureList::iterator i = std::find(features.begin(), features.end(), name);
if (i != features.end()) {
return i->enable;
} else {
return false;
}
}

ToolList getAllTools() {
const size_t toolCount = sizeof(s_tools) / sizeof(s_tools[0]);

@@ -211,6 +211,15 @@ StringList getFeatureLibraries(const FeatureList &features);
*/
bool setFeatureBuildState(const std::string &name, FeatureList &features, bool enable);

/**
* Gets the state of a given feature.
*
* @param name Name of the feature.
* @param features List of features to operate on.
* @return "true", when the feature is enabled, "false" otherwise.
*/
bool getFeatureBuildState(const std::string &name, FeatureList &features);

/**
* Structure to describe a build setup.
*
@@ -486,11 +486,16 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
DEF_LOCALLIB_STATIC("libpng");
}
if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS") || CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
if (CONTAINS_DEFINE(setup.defines, "USE_OGG")) {
DEF_LOCALLIB_STATIC("libogg");
}
if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
DEF_LOCALLIB_STATIC("libvorbis");
DEF_LOCALLIB_STATIC("libvorbisfile");
}
if (CONTAINS_DEFINE(setup.defines, "USE_TREMOR")) {
DEF_LOCALLIB_STATIC("libvorbisidec");
}
if (CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
DEF_LOCALLIB_STATIC("libtheoradec");
}
@@ -549,11 +554,16 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
frameworks_iOS.push_back("libpng.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS") || CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
if (CONTAINS_DEFINE(setup.defines, "USE_OGG")) {
frameworks_iOS.push_back("libogg.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
frameworks_iOS.push_back("libvorbis.a");
frameworks_iOS.push_back("libvorbisfile.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_TREMOR")) {
frameworks_iOS.push_back("libvorbisidec.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
frameworks_iOS.push_back("libtheoradec.a");
}
@@ -632,11 +642,16 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
frameworks_osx.push_back("libpng.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS") || CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
if (CONTAINS_DEFINE(setup.defines, "USE_OGG")) {
frameworks_osx.push_back("libogg.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
frameworks_osx.push_back("libvorbis.a");
frameworks_osx.push_back("libvorbisfile.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_TREMOR")) {
frameworks_osx.push_back("libvorbisidec.a");
}
if (CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
frameworks_osx.push_back("libtheoradec.a");
}

0 comments on commit 8fa2f90

Please sign in to comment.