Skip to content

Commit 25715c9

Browse files
committed
Updated README.md with new build instructions
1 parent df565a9 commit 25715c9

1 file changed

Lines changed: 29 additions & 21 deletions

File tree

README.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -308,45 +308,53 @@ This project uses [CMake](https://cmake.org/) as a build system.
308308
## Windows
309309

310310
### Visual Studio
311-
Visual Studio has support for CMake since Visual Studio 2017. To open the project, run Visual Studio and under `File > Open > CMake...`
312-
select the CMakeList.txt from this directory.
311+
Visual Studio has built-in support for CMake projects. After opening the project, you should be able to select from the presets
312+
defined in the `CMakePresets.json` file.
313313

314-
The CMakeSettings.json in this project should already define both a 32 and 64 bit configuration.
315-
You can add new configurations in the combo box that contains the x64 config. Here you can change the build type to Release or RelWithDebInfo and duplicate the config
316-
for a 32 bit build.
314+
After selecting a preset, Visual Studio should automatically download the required dependencies using vcpkg.
317315

318-
To build the project, you can then simply run `` from the toolbar. The output files are placed in the `out/build/{ConfigurationName}/` subfolder
316+
To build the project, you can then run `Build > Build All` from the toolbar. The output files are placed in the `out/build/{ConfigurationName}/` subfolder
319317
of this project.
320318

319+
The CMakeSettings.json in this project should already define both a 32- and 64-bit configuration.
320+
You can add new configurations in the combo box that contains the x64 config. Here you can change the build type to Release or RelWithDebInfo and duplicate the config
321+
for a 32-bit build.
321322

322-
### CLion
323-
Simply open the project in CLion and import the CMake project. Assuming you have a [valid toolchain](https://www.jetbrains.com/help/clion/how-to-create-toolchain-in-clion.html) setup,
324-
you can simply build the project using `Build > Build Project` in the toolbar.
323+
To build the project, you can then simply run `Build > Build All` from the toolbar. The output files are placed in the `out/build/{ConfigurationName}/` subfolder
324+
of this project.
325325

326-
To compile for 32 bit rather than 64 bit, you can select a 32 bit VS toolchain, rather than the 64 bit one.
326+
### CLion
327+
Before opening the project in CLion, ensure that you have a [valid toolchain](https://www.jetbrains.com/help/clion/how-to-create-toolchain-in-clion.html) set up.
327328

328-
The output files are placed within the `cmake-build-debug/` directory of this project.
329+
After opening the project in CLion, you should get a dialog showing you the available presets.
330+
Select the preset for 32- or 64-bit (depending on which you want to build) and press the duplicate button.
331+
Then, in the options for your new preset, select the correct toolchain (again, either 32- or 64-bit) and select to
332+
explicitly use `Ninja` as the generator.
333+
After applying and setting it as the active preset, you can build the project using `Build > Build Project` in the toolbar.
329334

335+
The output files are placed within the `cmake-build-*-release/` directory of this project.
330336

331337
## Linux
332338

333-
334339
### Prerequisites
335-
To compile the project, you will need CMake and a functioning c++ compiler. For example, under Ubuntu, the following packages
340+
To compile the project, you will need CMake and a functioning C++ compiler. For example, under Ubuntu, the following packages
336341
can be used to compile the module.
337342
```bash
338-
sudo apt install build-essential gcc-multilib cmake
343+
sudo apt install build-essential gcc-multilib g++-multilib cmake zip pkg-config
339344
```
340345

341346
### Compiling
342-
To compile the module, follow the following steps:
343-
- enter the project directory and run `cmake .` in bash.
344-
- in the same directory run `make` in bash.
345-
- The module should be compiled and the resulting binary should be placed directly in the project directory.
347+
The easiest way to compile this module is to use the convenience script `build.sh` located in this folder.
348+
> [!NOTE]
349+
> The script downloads vcpkg for you into your user's home directory. If this is unwanted, you can adjust the script to change
350+
> the target directory.
351+
- Enter the folder in bash
352+
- Run `./build.sh <target>` with the target depending on 32- or 64-bit
353+
- `./build.sh linux-x86-release` for 32-bit
354+
- `./build.sh linux-x64-release` for 64-bit
355+
- The module should be compiled and the resulting binary should be placed in the `cmake-build-*-release/` directory
346356

347357

348358

349359
## Mac
350-
Mac is currently not supported since the MariaDB connector is not available on Mac (at least not precompiled).
351-
However, if you are able to compile the connector yourself, building for Mac should broadly follow the same instructions
352-
as for Linux.
360+
Mac is currently not supported but you might be able to get it to work using the same instructions as for Linux.

0 commit comments

Comments
 (0)