.fx Files

Not all platforms supported by the Elements compiler provide the rich metadata that is required by the compiler to use the library, as part of the binary. For example, the Cocoa platform and many of the base platforms for Island depend on Objective-C or C header files (.h) normally processed by a C compiler at compile time.

Elements uses .fx files to express metadata for these binaries, so that the .h files do not need to be processed on each compile, and/or to provide metadata for libraries created by Elements itself.

.fx files contain a quick-to-process binary representation of the types and APIs exposed by a binary, as well as additional related meta data (for example un-mapping of obfuscated names, Swifty-fied names, and more.

  • .NET contains metadata in the .dll files themselves, so .fx are optional and not required.
  • Java contains metadata in the .jar files themselves, so.fx are optional and not required.
  • Cocoa and the Island-packed platforms use .fx files for libraries (.a, .lib, .dll, .dylib, .so etc) and Cocoa frameworks (.framework).

Imported .fx Files

Some .fx files are imported from C or Objective-C .h Header files using the FXGen tool or an Import Projects. This includes all the base SDK framework .fx files for Cocoa that ship with Elements, as well as the core rtl.fx library that provides the lowlevel platform APIs on both Cocoa and the Island-backed platforms.

If you have existing C or Objective-C style libraries as a binary and one or more .h. files, or as a .framework, then you can import those too with an Import Projects, in order to generate a .fx file that you can then referene in your Cocoa or Island projects.

The core Cocoa SDKs are imported not via Import Projects, but via a special tool that automates framework discovery for a given copy of Xcode and imports all SDKs in one go. While you will rarely need to import these yourself, ths tool is available as open -source project called HI2.

Compiler-Generated .fx Files

When building libraries for Cocoa and Island with Elements, the compiler can of course avoid the extra step of generating and re-importing a .h file, and will emit a rich .fx file with all metadata for the library, automatically.

(You can still have the compiler also generate an optional .h file, if you want the library to be used from Xcode or from any C/C++ compiler available for the respective platform.)

For .NET and Java projects, generation of .fx files can be optionally enabled in Project Settings by setting the CreateFXFile option to True.

See Also