Difference between revisions of "Custom compiler"

From Code::Blocks
Line 8: Line 8:
 
:Note if you use the supplied mingw binaries, you have to define BISON_SIMPLE=%CB%\share\bison.simple, BISON_HAIRY=%CB%\share\bison.hairy as environment variables. Otherwise you could install http://gnuwin32.sourceforge.net/packages/bison.htm (Setup, without binaries has all required DLLs) and just add the "bin" directory to your System's PATH environment variable.
 
:Note if you use the supplied mingw binaries, you have to define BISON_SIMPLE=%CB%\share\bison.simple, BISON_HAIRY=%CB%\share\bison.hairy as environment variables. Otherwise you could install http://gnuwin32.sourceforge.net/packages/bison.htm (Setup, without binaries has all required DLLs) and just add the "bin" directory to your System's PATH environment variable.
 
:BISON_SIMPLE, BISON_HAIRY information taken from http://board.planetpeer.de/index.php?topic=456.0;prev_next=prev.
 
:BISON_SIMPLE, BISON_HAIRY information taken from http://board.planetpeer.de/index.php?topic=456.0;prev_next=prev.
 +
 +
::More a feature request than working example. It seems difficult to make Code::Blocks put the .cpp file into the source tree.
  
 
== Compiler Parameters ==
 
== Compiler Parameters ==

Revision as of 04:02, 23 August 2006

TODO Text about what custom compiler does.

Bison Example

For example enable Custom Compiler to generate a cpp file form a bison grammatic.

Given a bison file "myparser.ypp" in your source tree. Select properties, go to advanced tab, tick custom compiler and add the line "bison $file".

Note if you use the supplied mingw binaries, you have to define BISON_SIMPLE=%CB%\share\bison.simple, BISON_HAIRY=%CB%\share\bison.hairy as environment variables. Otherwise you could install http://gnuwin32.sourceforge.net/packages/bison.htm (Setup, without binaries has all required DLLs) and just add the "bin" directory to your System's PATH environment variable.
BISON_SIMPLE, BISON_HAIRY information taken from http://board.planetpeer.de/index.php?topic=456.0;prev_next=prev.
More a feature request than working example. It seems difficult to make Code::Blocks put the .cpp file into the source tree.

Compiler Parameters

  • $compiler
  • $linker
  • $lib_linker
  • $rescomp
  • $options
  • $link_options
  • $includes
  • $res_includes
  • $libdirs
  • $libs
  • $file - current file being compiled
  • $dep_object
  • $object
  • $resource_output
  • $exe_output
  • $exe_output
  • $link_resobjects
  • $link_objects
  • $link_flat_objects
  • $static_output
  • $def_output
  • MACROS - also all macros are applied to the commandline string

The following were added to support the QUICK HACK in compiler plugin: DirectCommands::GetTargetLinkCommands()

  • $+link_objects
  • $-link_objects
  • $-+link_objects
  • $+-link_objects

Implementation Details can be found here: http://svn.berlios.de/svnroot/repos/codeblocks/trunk/src/sdk/compilercommandgenerator.cpp