23 May 2013

Spelling fix, improved module support and Windows fast compile option.

We've made a few changes, one of which alters the interface for the recently introduced runtime source dependency. The main changes are:

  1. The macro for the runtime source dependency has had it's spelling corrected, and is now RUNTIME_COMPILER_SOURCEDEPENDENCY (no longer missing the second D). We've also cleaned up the internals as several different wrong spellings of 'dependency' were in use!
  2. On initialization the runtime object system now directly uses the PerModuleInterface::GetInstance(), rather than querying the executable. This way RCC++ can be used in a DLL in the project, and multiple DLL's are supported though you will need to explicitly call RuntimeObjectSystem::SetupObjectConstructors() for each one.
  3. On Windows, the compiler now kills the compile cmd process by default when complete. This adds about 0.3s to the startup of following compiles due to running the batch file for Visual Studio to set up the environment variables, however it resolves an issue where the cmd process was holding onto handles (for example sockets) the main process wanted to close. This is especially a problem if the main process terminated abnormally, as a zombie cmd process is then left behind. To get faster compiles by keeping the cmd process alive (with the risks this entails), call the RuntimeObjectSystem::SetFastCompileMode() function with true as the parameter.
The full change list can be found here.

5 comments:

  1. Is it possible to alter the linker options of runtime-compiled c++? Like Ignore Default Libraries: Yes (/NODEFAULTLIB)

    ReplyDelete
  2. Yes, this is possible using the RuntimeObjectSystem::SetAdditionalLinkOptions( const char *options ) function or by altering the compiler line in the Compiler_PlatformWindows.cpp (for Windows).

    Note that the SetAdditionalLinkOptions hasn't had significant testing, and I don't think I've implemented it for the Linux/MacOSX compiler (will add this to my todo list). Let me know if you have any issues.

    ReplyDelete
  3. Exactly how is the commands to be lined up? "NoDefaultLib,"?

    ReplyDelete
  4. The string passed in is added to the options passed to the command line compiler. See here for details on the NoDefaultLib: http://msdn.microsoft.com/en-us/library/3tz4da4a.aspx

    So I think you need to have the string "/NODEFAULTLIB"

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete