-- -- codeblocks_cbp.lua -- Generate a Code::Blocks C/C++ project. -- Copyright (c) 2009, 2011 Jason Perkins and the Premake project -- local codeblocks = premake.codeblocks -- -- Write out a list of the source code files in the project. -- function codeblocks.files(prj) local pchheader if (prj.pchheader) then pchheader = path.getrelative(prj.location, prj.pchheader) end for fcfg in premake.project.eachfile(prj) do _p(2,'', premake.esc(fcfg.name)) if fcfg.name ~= fcfg.vpath then _p(3,'') end end function premake.codeblocks.debugenvs(cfg) --Assumption: if gcc is being used then so is gdb although this section will be ignored by --other debuggers. If using gcc and not gdb it will silently not pass the --environment arguments to the debugger if premake.gettool(cfg) == premake.gcc then _p(3,'') _p(4,'', premake.esc(cfg.longname)) local args = '' local sz = #cfg.debugenvs for idx, v in ipairs(cfg.debugenvs) do args = args .. 'set env ' .. v if sz ~= idx then args = args .. ' ' end end _p(5,'',args) _p(4,'') _p(3,'') else error('Sorry at this moment there is no support for debug environment variables with this debugger and codeblocks') end end -- -- The main function: write out the project file. -- function premake.codeblocks.cbp(prj) -- alias the C/C++ compiler interface local cc = premake.gettool(prj) _p('') _p('') _p(1,'') -- write project block header _p(1,'') _p(2,'') _p('') _p('') end