aboutsummaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorCameron Cawley2018-11-03 23:06:10 +0000
committerDavid Turner2018-11-27 22:58:02 +0000
commit8fa2f90a2638f9d635cc2e1e55093e671734274c (patch)
treedcf2cc1d79bec26e64001696d8f2f03f6e268639 /devtools
parente016efce564eef518461a665d39ab1dc9056a7ff (diff)
downloadscummvm-rg350-8fa2f90a2638f9d635cc2e1e55093e671734274c.tar.gz
scummvm-rg350-8fa2f90a2638f9d635cc2e1e55093e671734274c.tar.bz2
scummvm-rg350-8fa2f90a2638f9d635cc2e1e55093e671734274c.zip
CREATE_PROJECT: Support building with Tremor instead of Vorbis
Diffstat (limited to 'devtools')
-rw-r--r--devtools/create_project/cmake.cpp4
-rw-r--r--devtools/create_project/create_project.cpp18
-rw-r--r--devtools/create_project/create_project.h9
-rw-r--r--devtools/create_project/xcode.cpp21
4 files changed, 47 insertions, 5 deletions
diff --git a/devtools/create_project/cmake.cpp b/devtools/create_project/cmake.cpp
index 20f868299a..fcd1cf5c1a 100644
--- a/devtools/create_project/cmake.cpp
+++ b/devtools/create_project/cmake.cpp
@@ -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" },
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index cbf30adae8..3dab08a0b3 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -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]);
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index fc3df8154a..af4de291e4 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -212,6 +212,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.
*
* This includes various information about which engines to
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index e6ba6a8ba1..a04d250a3e 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -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");
}