From 9717d5be6f416a36dfb81e1c47c9cea518b5d018 Mon Sep 17 00:00:00 2001
From: Julien
Date: Wed, 1 Jun 2011 17:34:32 -0400
Subject: CREATE_PROJECT: Add stubs for Xcode provider
---
.../create_project/codeblocks/create_project.cbp | 2 +
devtools/create_project/create_project.cpp | 41 ++++++++++++++-
devtools/create_project/module.mk | 3 +-
.../create_project/msvc10/create_project.vcxproj | 8 ++-
.../msvc10/create_project.vcxproj.filters | 6 +++
.../create_project/msvc8/create_project.vcproj | 8 +++
.../create_project/msvc9/create_project.vcproj | 8 +++
devtools/create_project/xcode.cpp | 61 ++++++++++++++++++++++
devtools/create_project/xcode.h | 54 +++++++++++++++++++
.../xcode/create_project.xcodeproj/project.pbxproj | 6 +++
10 files changed, 192 insertions(+), 5 deletions(-)
create mode 100644 devtools/create_project/xcode.cpp
create mode 100644 devtools/create_project/xcode.h
(limited to 'devtools/create_project')
diff --git a/devtools/create_project/codeblocks/create_project.cbp b/devtools/create_project/codeblocks/create_project.cbp
index 25b12d8cc2..1b592d5e96 100644
--- a/devtools/create_project/codeblocks/create_project.cbp
+++ b/devtools/create_project/codeblocks/create_project.cbp
@@ -47,6 +47,8 @@
+
+
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 7573f115e9..29bc5bfcd5 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -28,11 +28,12 @@
#include "config.h"
#include "create_project.h"
-#include "codeblocks.h"
+#include "codeblocks.h"
#include "msvc.h"
#include "visualstudio.h"
#include "msbuild.h"
+#include "xcode.h"
#include
#include
@@ -107,7 +108,8 @@ typedef std::list FileList;
enum ProjectType {
kProjectNone,
kProjectCodeBlocks,
- kProjectMSVC
+ kProjectMSVC,
+ kProjectXcode
};
int main(int argc, char *argv[]) {
@@ -175,6 +177,14 @@ int main(int argc, char *argv[]) {
projectType = kProjectMSVC;
+ } else if (!std::strcmp(argv[i], "--xcode")) {
+ if (projectType != kProjectNone) {
+ std::cerr << "ERROR: You cannot pass more than one project type!\n";
+ return -1;
+ }
+
+ projectType = kProjectXcode;
+
} else if (!std::strcmp(argv[i], "--msvc-version")) {
if (i + 1 >= argc) {
std::cerr << "ERROR: Missing \"version\" parameter for \"--msvc-version\"!\n";
@@ -463,6 +473,32 @@ int main(int argc, char *argv[]) {
provider = new CreateProjectTool::MSBuildProvider(globalWarnings, projectWarnings, msvcVersion);
break;
+
+ case kProjectXcode:
+ ////////////////////////////////////////////////////////////////////////////
+ // Xcode is also using GCC behind the scenes. See Code::Blocks comment
+ // for info on all warnings
+ ////////////////////////////////////////////////////////////////////////////
+ globalWarnings.push_back("-Wall");
+ globalWarnings.push_back("-Wno-long-long");
+ globalWarnings.push_back("-Wno-multichar");
+ globalWarnings.push_back("-Wno-unknown-pragmas");
+ globalWarnings.push_back("-Wno-reorder");
+ globalWarnings.push_back("-Wpointer-arith");
+ globalWarnings.push_back("-Wcast-qual");
+ globalWarnings.push_back("-Wcast-align");
+ globalWarnings.push_back("-Wshadow");
+ globalWarnings.push_back("-Wimplicit");
+ globalWarnings.push_back("-Wnon-virtual-dtor");
+ globalWarnings.push_back("-Wwrite-strings");
+ // The following are not warnings at all... We should consider adding them to
+ // a different list of parameters.
+ globalWarnings.push_back("-fno-rtti");
+ globalWarnings.push_back("-fno-exceptions");
+ globalWarnings.push_back("-fcheck-new");
+
+ provider = new CreateProjectTool::XCodeProvider(globalWarnings, projectWarnings);
+ break;
}
provider->createProject(setup);
@@ -501,6 +537,7 @@ void displayHelp(const char *exe) {
"Project specific settings:\n"
" --codeblock build Code::Blocks project files\n"
" --msvc build Visual Studio project files\n"
+ " --xcode build XCode project files\n"
" --file-prefix prefix allow overwriting of relative file prefix in the\n"
" MSVC project files. By default the prefix is the\n"
" \"path\\to\\source\" argument\n"
diff --git a/devtools/create_project/module.mk b/devtools/create_project/module.mk
index 4238452c5d..025cbf4ba3 100644
--- a/devtools/create_project/module.mk
+++ b/devtools/create_project/module.mk
@@ -6,7 +6,8 @@ MODULE_OBJS := \
codeblocks.o \
msvc.o \
visualstudio.o \
- msbuild.o
+ msbuild.o \
+ xcode.o
# Set the name of the executable
TOOL_EXECUTABLE := create_project
diff --git a/devtools/create_project/msvc10/create_project.vcxproj b/devtools/create_project/msvc10/create_project.vcxproj
index bf5e415b5d..3d7f8fdd3d 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj
+++ b/devtools/create_project/msvc10/create_project.vcxproj
@@ -58,10 +58,12 @@
MachineX86
- xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc10\
+ @echo off
+xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc10\
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc9\
xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc8\
-xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\
+xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\
+xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\iphone\
@@ -98,6 +100,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\
+
@@ -106,6 +109,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\
+
diff --git a/devtools/create_project/msvc10/create_project.vcxproj.filters b/devtools/create_project/msvc10/create_project.vcxproj.filters
index b5e870824e..5ecd6c3dde 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj.filters
+++ b/devtools/create_project/msvc10/create_project.vcxproj.filters
@@ -27,6 +27,9 @@
Header Files
+
+ Header Files
+
Header Files
@@ -47,6 +50,9 @@
Source Files
+
+ Source Files
+
diff --git a/devtools/create_project/msvc8/create_project.vcproj b/devtools/create_project/msvc8/create_project.vcproj
index 639b23d6e7..6e9e0d5cb0 100644
--- a/devtools/create_project/msvc8/create_project.vcproj
+++ b/devtools/create_project/msvc8/create_project.vcproj
@@ -184,6 +184,10 @@
RelativePath="..\visualstudio.cpp"
>
+
+
+
+
+
+
+
+
+#include
+
+#if defined(_WIN32) || defined(WIN32)
+#include
+#else
+#include
+#include
+#include
+#include
+#endif
+
+namespace CreateProjectTool {
+
+XCodeProvider::XCodeProvider(StringList &global_warnings, std::map &project_warnings, const int version)
+ : ProjectProvider(global_warnings, project_warnings, version) {
+}
+
+void XCodeProvider::createWorkspace(const BuildSetup &setup) {
+ // TODO
+}
+
+void XCodeProvider::createOtherBuildFiles(const BuildSetup &setup) {
+ // TODO
+}
+
+void XCodeProvider::createProjectFile(const std::string &, const std::string &, const BuildSetup &setup, const std::string &moduleDir,
+ const StringList &includeList, const StringList &excludeList) {
+ // TODO
+}
+
+void XCodeProvider::writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int indentation,
+ const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix) {
+ // TODO
+}
+
+} // End of CreateProjectTool namespace
diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h
new file mode 100644
index 0000000000..a5810dbe0e
--- /dev/null
+++ b/devtools/create_project/xcode.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+
+#ifndef TOOLS_CREATE_PROJECT_XCODE_H
+#define TOOLS_CREATE_PROJECT_XCODE_H
+
+#include "create_project.h"
+
+#include
+#include
+
+namespace CreateProjectTool {
+
+ class XCodeProvider : public ProjectProvider {
+ public:
+ XCodeProvider(StringList &global_warnings, std::map &project_warnings, const int version = 0);
+
+ protected:
+
+ void createWorkspace(const BuildSetup &setup);
+
+ void createOtherBuildFiles(const BuildSetup &setup);
+
+ void createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
+ const StringList &includeList, const StringList &excludeList);
+
+ void writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int indentation,
+ const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix);
+
+ };
+
+} // End of CreateProjectTool namespace
+
+#endif // TOOLS_CREATE_PROJECT_XCODE_H
diff --git a/devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj b/devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj
index a14f53b3f0..3a3f6b1d4d 100644
--- a/devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj
+++ b/devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj
@@ -12,6 +12,7 @@
F9A66C6B1396D4DF00CEE494 /* msbuild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C651396D4DF00CEE494 /* msbuild.cpp */; };
F9A66C6C1396D4DF00CEE494 /* msvc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C671396D4DF00CEE494 /* msvc.cpp */; };
F9A66C6F1396D4E800CEE494 /* visualstudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */; };
+ F9A66C871396E2F500CEE494 /* xcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9A66C861396E2F500CEE494 /* xcode.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -44,6 +45,8 @@
F9A66C681396D4DF00CEE494 /* msvc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = msvc.h; path = ../msvc.h; sourceTree = ""; };
F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = visualstudio.cpp; path = ../visualstudio.cpp; sourceTree = ""; };
F9A66C6E1396D4E800CEE494 /* visualstudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = visualstudio.h; path = ../visualstudio.h; sourceTree = ""; };
+ F9A66C841396E2D800CEE494 /* xcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xcode.h; path = ../xcode.h; sourceTree = ""; };
+ F9A66C861396E2F500CEE494 /* xcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xcode.cpp; path = ../xcode.cpp; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -60,6 +63,8 @@
F9A66C1C1396D36100CEE494 = {
isa = PBXGroup;
children = (
+ F9A66C861396E2F500CEE494 /* xcode.cpp */,
+ F9A66C841396E2D800CEE494 /* xcode.h */,
F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */,
F9A66C6E1396D4E800CEE494 /* visualstudio.h */,
F9A66C5F1396D4DF00CEE494 /* codeblocks.cpp */,
@@ -148,6 +153,7 @@
F9A66C6B1396D4DF00CEE494 /* msbuild.cpp in Sources */,
F9A66C6C1396D4DF00CEE494 /* msvc.cpp in Sources */,
F9A66C6F1396D4E800CEE494 /* visualstudio.cpp in Sources */,
+ F9A66C871396E2F500CEE494 /* xcode.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
--
cgit v1.2.3