slice2objc Command-Line Options

The Slice-to-Objective-C compiler, slice2objc, offers the following command-line options in addition to the standard options:

  • --include-dir DIR
    Modifies #import directives in source files to prepend the path name of each header file with the directory DIR.
  • --dll-export MACRO
    Use MACRO to control the export of symbols from dynamic shared libraries. This option allows you to export symbols from the generated code and place such generated code in a shared library. Compiling a Slice definition with:

    $ slice2objc --dll-export WIDGET_API x.ice
    

     adds the provided MACRO name (WIDGET_API in our example) to the declaration of interfaces and protocols that need to be exported.  

    The generated code also defines the provided MACRO as __attribute__((visibility ("default"))).

    This option is useful when you create a shared library and compile your Objective-C code with -fvisibility=hidden to reduce the number of symbols exported.

See Also