Ice Builder for Xcode
Ice Builder for Xcode is a command line program to help compile Slice files to C++ or Objective-C in Xcode. It supports all recent versions of Xcode.
Install Ice Builder for Xcode using Homebrew by running the following commands:
brew install zeroc-ice/tap/ice-builder-xcode
Download the icebuilder shell script to any path on your system.
|--ice-home HOME||Set the Ice home directory.|
|-h, --help||Print usage message.|
|-v, --version||Display the version of Ice Builder.|
|-- ARGS||Arguments passed directly to the Slice compiler.|
If you do not set the Ice home directory with
--ice-home, the builder first
Additional SDKs of your project, and attempts to find its
in SDKs with
IceSDK in their path.
If there is no such SDK, the builder uses
/usr/local as its Ice home
icebuilder --cpp -- -DFOO=1 --checksum
The builder automatically adds the following include directories to the Slice compilation:
- the Ice Slice files directory provided by
- the directory of the Slice file being compiled
Xcode Build Rule
To use Ice Builder for Xcode, you must create a custom build rule in your Xcode project. For example:
Source files with names matching:
$(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).cpp(For a C++ project)
$(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).m(For an Objective-C project)
*.ice means Xcode will execute your custom script for each Slice
Output Files must list exactly two files: the header file and the
C++ or Objective-C implementation file generated by the Slice compiler.
These two files must be in the same directory: the builder sets
to this directory when it calls the Slice compiler.
Xcode Build Settings
Refer to the release notes of your Ice or Ice Touch distribution:
Generating Code using Xcode
The builder will always compile a Slice file when executed by an Xcode custom
build rule; however, Xcode custom build rules are only executed when either the
Output Files do not exist or are older than the file being processed.
To force your Slice files to be re-compiled you need to clean (⇧⌘K) your
project, then build (⌘B).