Skip to content

Options

Zeex edited this page Aug 24, 2018 · 4 revisions

-a

Output assembly listing to <script_name>.asm during compilation. You can use this to inspect the produced bytecode.

-d<N>

Debugging level.

The -d flag specifies how much debug information and runtime checks are included in the AMX file headers and the bytecode.

  • -d0 - no debug symbols and no runtime checks are emitted
  • -d1 - enables runtime checks such as array bounds checks (allows you to catch out-of-bounds array accesses with crashdetect), but still no debug symbols
  • -d2 - full debug information and all runtime checks
  • -d3 - same as -d2 but also disables optimization (implies -O0)

To get as much debug information as possible from debugging tools such as crashdetect you should use -d2 or -d3. But keep in mind that this makes your AMX file more easily decompilable because it will contain the names of all your functions and variables (among other things).

-D<path>

Working (active) directory path.

Active directory is the directory where all output files are saved. By default, the current working directory is used as the active directory, but this options lets you override that.

-i<path>

Add a directory to include directories.

Include directories are the directories where the compiler looks for #include files.

Examples:

  • -iC:\Users\user\SA-MP\include
  • -i/home/user/SA-MP/include

Note: Don't put a space between the -i and the path.

-O<N>

Optimization level.

  • -O0 - no optimization
  • -O1 - some optimization is performed, but only if compatible with the built-in JIT compiler (SA-MP doesn't use it)
  • -O2 - full optimization

-Z[+/-]

Toggle compatibility mode on or off (off by default).

When enabled, the compiler tries to stay compatible with the default SA-MP compiler that comes with the Windows package (SA-MP only has a Windows version of the compiler). See this page for more information.

symbol=value

Define a constant symbol with the value value.

Clone this wiki locally