2 * Copyright (C) 2005 Trevor McCort
3 * Copyright (C) 2005 Casper S. Hornstrup
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include "../backend.h"
44 CBConfiguration(const OptimizationType optimization
,
45 const std::string
&name
= "");
46 virtual ~CBConfiguration() {}
48 OptimizationType optimization
;
51 class CBBackend
: public Backend
55 CBBackend(Project
&project
,
56 Configuration
& configuration
);
57 virtual ~CBBackend() {}
59 virtual void Process();
63 void ProcessModules();
64 void ProcessFile(std::string
&filename
);
66 bool CheckFolderAdded(std::string
&folder
);
67 void AddFolders(std::string
&folder
);
70 void OutputFileUnits();
72 std::string
CbpFileName ( const Module
& module
) const;
73 std::string
LayoutFileName ( const Module
& module
) const;
74 std::string
DependFileName ( const Module
& module
) const;
75 std::string
GenerateProjectLinkerFlags () const;
76 void MingwAddImplicitLibraries( Module
&module
);
77 bool IsSpecDefinitionFile ( const Module
& module
) const;
78 std::vector
<CBConfiguration
*> m_configurations
;
80 std::vector
<FileUnit
> m_fileUnits
;
81 std::vector
<std::string
> m_folders
;
87 std::string
_replace_str(
89 const std::string
&find_str
,
90 const std::string
&replace_str
);
92 void _generate_workspace ( FILE* OUT
);
93 void _generate_cbproj ( const Module
& module
);
95 void _clean_project_files ( void );
96 void _get_object_files ( const Module
& module
, std::vector
<std::string
>& out
) const;
97 void _install_files ( const std::string
& vcdir
, const std::string
& config
);
98 bool _copy_file ( const std::string
& inputname
, const std::string
& targetname
) const;
99 const Property
* _lookup_property ( const Module
& module
, const std::string
& name
) const;