diff options
author | Julien Templier | 2011-01-24 12:41:02 +0000 |
---|---|---|
committer | Julien Templier | 2011-01-24 12:41:02 +0000 |
commit | d18a96fb0ee00df4903f953b63145389e7974693 (patch) | |
tree | f62c2ad93326f1be168833175b48374e9cdcdc02 /tools/create_project | |
parent | aa5e8e6c2bbd57bb183fd3c1f936b52767fe3941 (diff) | |
download | scummvm-rg350-d18a96fb0ee00df4903f953b63145389e7974693.tar.gz scummvm-rg350-d18a96fb0ee00df4903f953b63145389e7974693.tar.bz2 scummvm-rg350-d18a96fb0ee00df4903f953b63145389e7974693.zip |
TOOLS: Add better Code::Blocks support to create_project
- Update searchs path and library names to use the mingw precompiled libraries directly
- Enhance batch file to handle the same arguments as the MSVC one
svn-id: r55499
Diffstat (limited to 'tools/create_project')
-rw-r--r-- | tools/create_project/codeblocks.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/create_project/codeblocks.cpp b/tools/create_project/codeblocks.cpp index aefba3a1ba..b5fd743ee1 100644 --- a/tools/create_project/codeblocks.cpp +++ b/tools/create_project/codeblocks.cpp @@ -57,6 +57,22 @@ void CodeBlocksProvider::createWorkspace(const BuildSetup &setup) { "</CodeBlocks_workspace_file>"; } +// HACK We need to pre-process library names +// since the MSVC and mingw precompiled +// librarie have different names :( +std::string processLibraryName(std::string name) { + // Remove "_static" in lib name + size_t pos = name.find("_static"); + if (pos != std::string::npos) + return name.replace(pos, 7, ""); + + // Replace "zlib" by "libz" + if (name == "zlib") + return "libz"; + + return name; +} + void CodeBlocksProvider::createProjectFile(const std::string &name, const std::string &, const BuildSetup &setup, const std::string &moduleDir, const StringList &includeList, const StringList &excludeList) { @@ -78,7 +94,7 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s std::string libraries; for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i) - libraries += *i + ".a;"; + libraries += processLibraryName(*i) + ".a;"; project << "\t\t\t<Target title=\"default\">\n" "\t\t\t\t<Option output=\"scummvm\\scummvm\" prefix_auto=\"1\" extension_auto=\"1\" />\n" @@ -97,6 +113,7 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s writeDefines(setup.defines, project); project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\" />\n" + "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\\SDL\" />\n" "\t\t\t\t\t<Add directory=\"..\\..\\engines\" />\n" "\t\t\t\t\t<Add directory=\"..\\..\\common\" />\n" "\t\t\t\t\t<Add directory=\"..\\..\" />\n" @@ -107,7 +124,7 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s project << "\t\t\t\t<Linker>\n"; for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i) - project << "\t\t\t\t\t<Add library=\"" << *i << "\" />\n"; + project << "\t\t\t\t\t<Add library=\"" << processLibraryName(*i) << "\" />\n"; for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) { if (i->first == "scummvm") @@ -117,6 +134,7 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s } project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)lib\\mingw\" />\n" + "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)lib\" />\n" "\t\t\t\t</Linker>\n"; ////////////////////////////////////////////////////////////////////////// |