diff options
author | Julien | 2011-06-01 17:34:32 -0400 |
---|---|---|
committer | Julien | 2011-06-01 17:34:32 -0400 |
commit | 9717d5be6f416a36dfb81e1c47c9cea518b5d018 (patch) | |
tree | 3feeb9cc9d59651086871d1fb4d1afdf1891fc31 /devtools/create_project | |
parent | 9db33ea544afd2c24857b8229e97e532881383ca (diff) | |
download | scummvm-rg350-9717d5be6f416a36dfb81e1c47c9cea518b5d018.tar.gz scummvm-rg350-9717d5be6f416a36dfb81e1c47c9cea518b5d018.tar.bz2 scummvm-rg350-9717d5be6f416a36dfb81e1c47c9cea518b5d018.zip |
CREATE_PROJECT: Add stubs for Xcode provider
Diffstat (limited to 'devtools/create_project')
-rw-r--r-- | devtools/create_project/codeblocks/create_project.cbp | 2 | ||||
-rw-r--r-- | devtools/create_project/create_project.cpp | 41 | ||||
-rw-r--r-- | devtools/create_project/module.mk | 3 | ||||
-rw-r--r-- | devtools/create_project/msvc10/create_project.vcxproj | 8 | ||||
-rw-r--r-- | devtools/create_project/msvc10/create_project.vcxproj.filters | 6 | ||||
-rw-r--r-- | devtools/create_project/msvc8/create_project.vcproj | 8 | ||||
-rw-r--r-- | devtools/create_project/msvc9/create_project.vcproj | 8 | ||||
-rw-r--r-- | devtools/create_project/xcode.cpp | 61 | ||||
-rw-r--r-- | devtools/create_project/xcode.h | 54 | ||||
-rw-r--r-- | devtools/create_project/xcode/create_project.xcodeproj/project.pbxproj | 6 |
10 files changed, 192 insertions, 5 deletions
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 @@ <Unit filename="..\msvc.h" /> <Unit filename="..\visualstudio.cpp" /> <Unit filename="..\visualstudio.h" /> + <Unit filename="..\xcode.cpp" /> + <Unit filename="..\xcode.h" /> <Extensions> <code_completion /> <envvars /> 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 <fstream> #include <iostream> @@ -107,7 +108,8 @@ typedef std::list<FSNode> 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 @@ <TargetMachine>MachineX86</TargetMachine> </Link> <PostBuildEvent> - <Command>xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\msvc10\ + <Command>@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\</Command> +xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\ +xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\iphone\</Command> </PostBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> @@ -98,6 +100,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command> <ClCompile Include="..\msbuild.cpp" /> <ClCompile Include="..\msvc.cpp" /> <ClCompile Include="..\visualstudio.cpp" /> + <ClCompile Include="..\xcode.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\codeblocks.h" /> @@ -106,6 +109,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command> <ClInclude Include="..\msbuild.h" /> <ClInclude Include="..\msvc.h" /> <ClInclude Include="..\visualstudio.h" /> + <ClInclude Include="..\xcode.h" /> </ItemGroup> <ItemGroup> <None Include="..\scripts\installer.vbs" /> 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 @@ <ClInclude Include="..\visualstudio.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="..\xcode.h"> + <Filter>Header Files</Filter> + </ClInclude> <ClInclude Include="..\config.h"> <Filter>Header Files</Filter> </ClInclude> @@ -47,6 +50,9 @@ <ClCompile Include="..\visualstudio.cpp"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\xcode.cpp"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <None Include="..\scripts\prebuild.cmd"> 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" > </File> + <File + RelativePath="..\xcode.cpp" + > + </File> </Filter> <Filter Name="Header Files" @@ -214,6 +218,10 @@ RelativePath="..\visualstudio.h" > </File> + <File + RelativePath="..\xcode.h" + > + </File> </Filter> <Filter Name="Scripts" diff --git a/devtools/create_project/msvc9/create_project.vcproj b/devtools/create_project/msvc9/create_project.vcproj index f56cbd711c..dc914248fb 100644 --- a/devtools/create_project/msvc9/create_project.vcproj +++ b/devtools/create_project/msvc9/create_project.vcproj @@ -185,6 +185,10 @@ RelativePath="..\visualstudio.cpp" > </File> + <File + RelativePath="..\xcode.cpp" + > + </File> </Filter> <Filter Name="Header Files" @@ -215,6 +219,10 @@ RelativePath="..\visualstudio.h" > </File> + <File + RelativePath="..\xcode.h" + > + </File> </Filter> <Filter Name="Scripts" diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp new file mode 100644 index 0000000000..f26c847c83 --- /dev/null +++ b/devtools/create_project/xcode.cpp @@ -0,0 +1,61 @@ +/* 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. + * + */ + +#include "xcode.h" + +#include <fstream> +#include <algorithm> + +#if defined(_WIN32) || defined(WIN32) +#include <windows.h> +#else +#include <sys/param.h> +#include <sys/stat.h> +#include <dirent.h> +#include <errno.h> +#endif + +namespace CreateProjectTool { + +XCodeProvider::XCodeProvider(StringList &global_warnings, std::map<std::string, StringList> &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 <algorithm> +#include <vector> + +namespace CreateProjectTool { + + class XCodeProvider : public ProjectProvider { + public: + XCodeProvider(StringList &global_warnings, std::map<std::string, StringList> &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 = "<group>"; }; F9A66C6D1396D4E800CEE494 /* visualstudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = visualstudio.cpp; path = ../visualstudio.cpp; sourceTree = "<group>"; }; F9A66C6E1396D4E800CEE494 /* visualstudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = visualstudio.h; path = ../visualstudio.h; sourceTree = "<group>"; }; + F9A66C841396E2D800CEE494 /* xcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xcode.h; path = ../xcode.h; sourceTree = "<group>"; }; + F9A66C861396E2F500CEE494 /* xcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xcode.cpp; path = ../xcode.cpp; sourceTree = "<group>"; }; /* 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; }; |