Skip to content

Setting Additional Compile and Link Options

dougbinks edited this page Sep 8, 2014 · 3 revisions

Additional compile and link options (which are compiler specific) can be added to projects via the IRuntimeObjectSystem interface functions:

virtual void SetAdditionalCompileOptions(   const char *options,    unsigned short projectId_ = 0 ) = 0;
virtual void SetAdditionalLinkOptions(      const char *options,    unsigned short projectId_ = 0 ) = 0;

Compile options are appended to the compile string after the standard RCC++ compile options. Link options are compiler dependent:

  • For Visual Studio added at the end of the compile string after /link and after the link options for library path, so the entire string is passed to the compiler. See Visual Studio Linker options on MSDN.
  • For gcc and clang++ added after -Wl, so flags and argument should be comma separated rather than space separated. Flags with arguments can also be passed in flag=argument form. An example string would be along the lines of linkFlag1,linkFlag2=arg1,linkFlag3,arg2,linkFlag4.

If you want to set compile optimizations through the additional compile options, you may want to set the RCC++ optimization level to RCCPPOPTIMIZATIONLEVEL_NOT_SET. See Controlling Optimization Levels.