Using a custom toolchain
By default, Qt Quick Ultralite supports ARM GCC, GHS, or IAR toolchains across the supported platforms. However, it is possible to use your own compiler in the project.
To configure Qt Quick Ultralite for your toolchain, follow these steps:
- Add a
- Edit CMake configuration files in Qt Quick Ultralite
<YOUR_COMPILER>.cmake to the
lib\cmake\Qul\toolchain directory. This file configures your toolchain for the project. You can also use existing toolchain configurations as a basis for your compiler configuration.
The following variables should be set in the file:
|The operating system CMake is building for. This must be set to
|The processor CMake is building for. For example, if your target CPU is ARM CPU, set this to
|Tells Qt Quick Ultralite project what compiler directory should be used for the target platform. This must match the name of the compiler directory in
platform\boards\<MANUFACTURER_NAME>\<YOUR_PLATFORM>\cmake or else you will get errors during configuration.
|This is used in
qul_platform_add_default_linker_script to tell linker what flags to use. If you are not using
LINKER_SCRIPT_OPTION, this is not needed.
|Path to the C compiler.
|Path to the C++ compiler.
|Path to the assembly compiler. This is not needed if you do not have assembly files in you platform.
|Path to the toolchain's archiver.
|C++ compiler flags that are used in every configuration.
|C compiler flags that are used in every configuration.
|C compiler flags that are used in debug configuration in addition to the flags used in
|C++ compiler flags that are used in debug configuration in addition to the flags used in
|Linker flags that are used in every configuration.
In addition, you also need to set a variable that can be used to identify your compiler:
This is used in other CMake files to configure additional things if needed.
Create a directory named
<YOUR_COMPILER> (or the name you set to
COMPILE_FOLDER_NAME in the previous step) for your toolchain in the
platform\boards\<MANUFACTURER_NAME>\<YOUR_PLATFORM>\cmake directory, and add all required files mentioned in the "
cmake directory" section.
Your toolchain may require some additional configuration in Qt Quick Ultralite.
The following files contain compiler-dependent configurations and might be worth checking out.
examples\CMakeLists.txthas compiler-dependent warning flags, such as
Werror. If your compiler does not support already provided flags, add your own here.
platform\CMakeLists.txtIf you are going to use same compiler on multiple platforms, it might be a good idea to write some common compilation options for
src\CMakeLists.txtis used to build
Coretarget. If your compiler has some specific arguments that must be taken into account, add them here.
The file also includes configuration code for supported compilers. Check that your compiler can use the set parameters and modify the code if needed.
src\pngdecoders.cmakeadds LodePNG based PNG decoder to Qt Quick Ultralite. If your compiler has some specific arguments that must be taken into account when building the decoder, add them here.
Your compiler setup is ready to be used now. Test it by running CMake with
Available under certain Qt licenses.
Find out more.