Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 1 | # CMake Options and Variables |
| 2 | |
| 3 | ## Frequently-used CMake Variables |
| 4 | |
| 5 | #### `CMAKE_BUILD_TYPE`:STRING |
| 6 | |
| 7 | Sets the build type. Possible values are `Release`, `Debug`, |
| 8 | `RelWithDebInfo`/`FastBuild` and `MinSizeRel`. If unset, build type is set to |
| 9 | `Release`. |
| 10 | |
| 11 | #### `CMAKE_<LANG>_COMPILER`:STRING |
| 12 | |
| 13 | This is the command that will be used as the `<LANG>` compiler, which are `C` |
| 14 | and `CXX` in IREE. These variables are set to compile IREE with `clang` or |
| 15 | rather `clang++`. Once set, these variables can not be changed. |
| 16 | |
| 17 | ## IREE-specific CMake Options and Variables |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 18 | |
| 19 | This gives a brief explanation of IREE specific CMake options and variables. |
| 20 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 21 | #### `IREE_ENABLE_RUNTIME_TRACING`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 22 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 23 | Enables instrumented runtime tracing. Defaults to `OFF`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 24 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 25 | #### `IREE_ENABLE_MLIR`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 26 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 27 | Enables MLIR/LLVM dependencies. Defaults to `ON`. MLIR/LLVM dependencies are |
| 28 | required when building the IREE compiler components. Therefore, the option is |
| 29 | automatically set to `ON` if `IREE_BUILD_COMPILER` is set to `ON`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 30 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 31 | #### `IREE_ENABLE_EMITC`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 32 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 33 | Enables the build of the out-of-tree MLIR dialect EmitC. Defaults to `OFF`. To |
| 34 | build the EmitC dialect, `IREE_ENABLE_MLIR` must be set to `ON`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 35 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 36 | #### `IREE_BUILD_COMPILER`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 37 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 38 | Builds the IREE compiler. Defaults to `ON`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 39 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 40 | #### `IREE_BUILD_TESTS`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 41 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 42 | Builds IREE unit tests. Defaults to `ON`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 43 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 44 | #### `IREE_BUILD_DOCS`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 45 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 46 | Builds IREE documentation. Defaults to `OFF`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 47 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 48 | #### `IREE_BUILD_SAMPLES`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 49 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 50 | Builds IREE sample projects. Defaults to `ON`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 51 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 52 | #### `IREE_BUILD_DEBUGGER`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 53 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 54 | Builds the IREE debugger app. Defaults to `OFF`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 55 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 56 | #### `IREE_BUILD_PYTHON_BINDINGS`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 57 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 58 | Builds the IREE python bindings. Defaults to `OFF`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 59 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 60 | #### `IREE_BUILD_EXPERIMENTAL`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 61 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 62 | Builds experimental projects. Defaults to `OFF`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 63 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 64 | #### `IREE_HAL_DRIVERS_TO_BUILD`:STRING |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 65 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 66 | *This does not have any effect at the moment, but will be supported in the |
| 67 | future!* Semicolon-separated list of HAL drivers to build, or `all` for building |
| 68 | all HAL drivers. Case-insensitive. Defaults to `all`. Example: |
| 69 | `-DIREE_HAL_DRIVERS_TO_BUILD="Vulkan;VMLA"`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 70 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 71 | #### `IREE_TARGET_BACKENDS_TO_BUILD`:STRING |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 72 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 73 | *This does not have any effect at the moment, but will be supported in the |
| 74 | future!* Semicolon-separated list of HAL drivers to build, or `all` for building |
| 75 | all HAL drivers. Case-insensitive. Defaults to `all`. Example: |
| 76 | `-DIREE_HAL_DRIVERS_TO_BUILD="Vulkan_SPIRV;VMLA"`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 77 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 78 | #### `IREE_ENABLE_LLD`:BOOL |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 79 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 80 | Use lld when linking. Defaults to `OFF`. This option is equivalent to |
| 81 | `-DIREE_USE_LINKER=lld`. The option `IREE_ENABLE_LLD` and `IREE_USE_LINKER` can |
| 82 | not be set at the same time. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 83 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 84 | #### `IREE_MLIR_DEP_MODE`:STRING |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 85 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 86 | Defines the MLIR dependency mode. Case-sensitive. Can be `BUNDLED`, `DISABLED` |
| 87 | or `INSTALLED`. Defaults to `BUNDLED`. If set to `INSTALLED`, the variable |
| 88 | `MLIR_DIR` needs to be passed and that LLVM needs to be compiled with |
| 89 | `LLVM_ENABLE_RTTI` set to `ON`. |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 90 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 91 | ## MLIR-specific CMake Options and Variables |
Marius Brehler | c3e9391 | 2020-06-18 16:06:24 -0700 | [diff] [blame] | 92 | |
Marius Brehler | c5c8b7c | 2020-06-22 14:38:05 -0700 | [diff] [blame^] | 93 | #### `MLIR_DIR`:STRING |
| 94 | |
| 95 | Specifies the path where to look for the installed MLIR/LLVM packages. Required |
| 96 | if `IREE_MLIR_DEP_MODE` is set to `INSTALLED`. |