1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
<% local cc = premake[_OPTIONS.cc] %>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="<%= premake.esc(this.name) %>" />
<Option pch_mode="2" />
<Option compiler="<%= _OPTIONS.cc %>" />
<Build>
<% for cfg in premake.eachconfig(this) do %>
<Target title="<%= premake.esc(cfg.name) %>">
<Option output="<%= premake.esc(cfg.buildtarget.fullpath) %>" prefix_auto="0" extension_auto="0" />
<Option object_output="<%= premake.esc(cfg.objectsdir) %>" />
<% if (cfg.kind == "WindowedApp") then %>
<Option type="0" />
<% elseif (cfg.kind == "ConsoleApp") then %>
<Option type="1" />
<% elseif (cfg.kind == "StaticLib") then %>
<Option type="2" />
<% elseif (cfg.kind == "SharedLib") then %>
<Option type="3" />
<% end %>
<Option compiler="<%= _OPTIONS.cc %>" />
<% if (cfg.kind == "SharedLib") then %>
<Option createDefFile="0" />
<Option createStaticLib="<%= iif(cfg.flags.NoImportLib, 0, 1) %>" />
<% end %>
<Compiler>
<% for _,flag in ipairs(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getdefines(cfg.defines), cfg.buildoptions)) do %>
<Add option="<%= premake.esc(flag) %>" />
<% end %>
<% if not cfg.flags.NoPCH and cfg.pchheader then %>
<Add option="-Winvalid-pch" />
<Add option="-include "<%= premake.esc(cfg.pchheader) %>"" />
<% end %>
<% for _,v in ipairs(cfg.includedirs) do %>
<Add directory="<%= premake.esc(v) %>" />
<% end %>
</Compiler>
<Linker>
<% for _,flag in ipairs(table.join(cc.getldflags(cfg), cfg.linkoptions)) do %>
<Add option="<%= premake.esc(flag) %>" />
<% end %>
<% for _,v in ipairs(premake.getlinks(cfg, "all", "directory")) do %>
<Add directory="<%= premake.esc(v) %>" />
<% end %>
<% for _,v in ipairs(premake.getlinks(cfg, "all", "basename")) do %>
<Add library="<%= premake.esc(v) %>" />
<% end %>
</Linker>
<% if premake.findfile(cfg, ".rc") then %>
<ResourceCompiler>
<% for _,v in ipairs(cfg.includedirs) do %>
<Add directory="<%= premake.esc(v) %>" />
<% end %>
<% for _,v in ipairs(cfg.resincludedirs) do %>
<Add directory="<%= premake.esc(v) %>" />
<% end %>
</ResourceCompiler>
<% end %>
<% if #cfg.prebuildcommands > 0 or #cfg.postbuildcommands > 0 then %>
<ExtraCommands>
<% for _,v in ipairs(cfg.prebuildcommands) do %>
<Add before="<%= premake.esc(v) %>" />
<% end %>
<% for _,v in ipairs(cfg.postbuildcommands) do %>
<Add after="<%= premake.esc(v) %>" />
<% end %>
</ExtraCommands>
<% end %>
</Target>
<% end %>
</Build>
<% for _,fname in ipairs(this.files) do %>
<Unit filename="<%= premake.esc(fname) %>">
<% if path.getextension(fname) == ".rc" then %>
<Option compilerVar="WINDRES" />
<% elseif path.iscppfile(fname) then %>
<Option compilerVar="<%= iif(this.language == "C", "CC", "CPP") %>" />
<% if (not this.flags.NoPCH and fname == this.pchheader) then %>
<Option compile="1" />
<Option weight="0" />
<% end %>
<% end %>
</Unit>
<% end %>
<Extensions />
</Project>
</CodeBlocks_project_file>
|