147 lines
5.6 KiB
Plaintext
147 lines
5.6 KiB
Plaintext
====Compiling the native Windows EFL ====
|
|
=== Preparing the build environment ===
|
|
|
|
The steps below correspond to the preparation of the **EFL native windows** compilation environment.
|
|
|
|
<note important>
|
|
**[Note!]**
|
|
|
|
These steps were tested on Windows server 2019 64bit and Windows 10 64bit.
|
|
</note>
|
|
|
|
Except for topic 6 (Environment variables) that can be consulted during the process of preparing the environment, the ideal is that the steps are fulfilled in the proposed order.
|
|
|
|
- Visual Studio installation
|
|
- Meson
|
|
- LLVM
|
|
- Vcpkg
|
|
- Compiling the EFL
|
|
|
|
----
|
|
|
|
=== 1 - Visual Studio installation ===
|
|
|
|
* Download the software from the official website: [[https://visualstudio.microsoft.com/|Visual Studio]];
|
|
|
|
* Choose the option you want. The most basic and free version is the [[https://visualstudio.microsoft.com/pt-br/thank-you-downloading-visual-studio/?sku=Community&rel=16 |Community]] version;
|
|
|
|
* After installation add the build package for C and C++;
|
|
|
|
* If there is no list of options for including the package, complete the installation and, in the Start Menu, search for Visual Studio Installer. You can add the package to C/C++, update or check if it was successfully installed.
|
|
|
|
----
|
|
|
|
=== 2 - Python ===
|
|
|
|
Meson depends on Python, so we need to install Python first.
|
|
|
|
Go to Python website and download the latest Python installation for Windows.
|
|
|
|
When installing it, select the option to add python to environment variables so it can be used in command-line.
|
|
|
|
=== 3 - Meson ===
|
|
|
|
3.1. Install [[https://pypi.org/project/meson/|Meson]] using the following command on the terminal (CMD or Developer Command Prompt from Visual Studio):
|
|
|
|
<code>
|
|
> pip install --user meson
|
|
</code>
|
|
|
|
> The version of meson used in this tutorial is the **0.53.2**. It is possible to directly install this version with:
|
|
> <code>> pip install meson==0.53.2</code>
|
|
> To check the installed version, use ''meson --version'' (or use ''pip freeze'' to check all installed packages and their versions).
|
|
|
|
> Check the python version installed on your Windows. In this tutorial we are using Python 3.8
|
|
|
|
3.2. At the end of the previous step, open a new terminal, type the command below and press enter:
|
|
|
|
<code>
|
|
> meson --version
|
|
</code>
|
|
|
|
The result should look like this:
|
|
<code>
|
|
0.53.2
|
|
</code>
|
|
|
|
If the command is not recognized, finish the environment variables step and try again. For additional help, check [[https://mesonbuild.com|The meson Official documentation]].
|
|
|
|
|
|
----
|
|
|
|
=== 3 - LLVM ===
|
|
|
|
3.1. Download LLVM from [[https://github.com/llvm/llvm-project/releases/|LLVM's official page]]. The version used in this tutorial is 9.0.1.
|
|
|
|
> Upon entering the corresponding section with the chosen version, a file with the following description (in this case with version 9.0.1) must be located: ''LLVM-9.0.1-win64.exe''. Download this file.
|
|
|
|
3.2. When installing, it is important to select at least one of the options below:
|
|
|
|
>[x] Add LLVM to the system PATH for all users.
|
|
>[x] Add LLVM to thr system PATH for current user.
|
|
|
|
In this tutorial, we install it in ''C:\Program Files\LLVM''.
|
|
|
|
----
|
|
|
|
=== 4. VCPKG ===
|
|
|
|
Vcpkg is not strictly necessary, since you could install each of the dependencies separately and make sure cmake finds it, but it is a more convenient way to do so and it is supported by EFL's current build system.
|
|
|
|
To manage dependencies with vcpkg:
|
|
|
|
4.1. Follow the **Vcpkg Installation Guide** in [[https://github.com/microsoft/vcpkg|Vcpkg's Github Repository]]. You should checkout a tag before bootstrapping like this:
|
|
|
|
<code>c:\vcpkg-path> git checkout 2020.07</code>
|
|
|
|
4.2. Install the following dependencies for x64 windows:
|
|
|
|
- Curl;
|
|
- OpenSSL;
|
|
- Freetype;
|
|
- Check;
|
|
- Libpng;
|
|
- Libjpeg-turbo;
|
|
- Zlib.
|
|
|
|
<code>
|
|
c:\vcpkg-path> vcpkg install openssl:x64-windows freetype:x64-windows check:x64-windows libpng:x64-windows zlib:x64-windows libjpeg-turbo:x64-windows curl:x64-windows
|
|
</code>
|
|
|
|
This way vcpkg will download, setup and install all of those dependencies.
|
|
|
|
Check that all dependencies were installed at ''installed\x64-windows\bin''.
|
|
|
|
----
|
|
|
|
=== 7 - Compiling EFL ===
|
|
|
|
Clone the [[https://github.com/expertisesolutions/efl.git|EFL Native Windows Repository]] repository.
|
|
|
|
<note>
|
|
The cmake found by meson still has to find the dependencies, but vcpkg's installed libraries aren't found by default. For that, [vcpkg's docummentation](https://github.com/microsoft/vcpkg#using-vcpkg-with-cmake) recommends using the cmake argument ''CMAKE_TOOLCHAIN_FILE'' to point to vcpkg's toolchain file.
|
|
|
|
''configure.bat'' uses the ''vcpkg_toolchain_file'' environment variable to pass the toolset as parameter to CMake from Meson.
|
|
</note>
|
|
|
|
Create an environment ''env.bat'' file in EFL's root (e.g. ''C:/Users/Someone/efl/env.bat'') before calling ''configure.bat'', containing for example (considering vcpkg is installed in ''C:\Users\Someone\vcpkg''):
|
|
|
|
<code>
|
|
c:\efl-path> echo set vcpkg_toolchain_file=C:\vcpkg-path\scripts\buildsystems\vcpkg.cmake > env.bat
|
|
</code>
|
|
|
|
This file is run everytime by ''configure.bat'' as a special way to set local custom environment variables.
|
|
|
|
It is necessary to add the vcpkg-installed dependencies to PATH environment variable so EFL binaries built and used in efl's build can find its dependencies.
|
|
|
|
<code>c:\efl-path> set "PATH=%PATH%;C:\path-to-vcpkg\installed\x64-windows\debug\bin;C:\path-to-vcpkg\installed\x64-windows\bin"</code>
|
|
|
|
Then we can configure and build and install
|
|
|
|
<code>c:\efl-path> configure.bat --prefix=C:\efl</code>
|
|
<code>c:\efl-path> build.bat</code>
|
|
<code>c:\efl-path> install.bat</code>
|
|
|
|
<code>c:\efl-path> cd efl-prefix-path
|
|
c:\efl-prefix-path> cd bin
|
|
c:\efl-prefix-path\bin> .\elementary_test.exe</code> |