Skip to content
Snippets Groups Projects
Commit 4e046442 authored by Vladimir Onoprienko's avatar Vladimir Onoprienko
Browse files

Update README.md

parent 7b472b88
No related tags found
1 merge request!5Document how to choose compiler and set flags
...@@ -127,3 +127,21 @@ Intel C++ Compiler should be used with `NMake Makefiles`, MinGW C++ should be us ...@@ -127,3 +127,21 @@ Intel C++ Compiler should be used with `NMake Makefiles`, MinGW C++ should be us
``` ```
cmake -B . -S ../exple-cmake-build -G"Visual Studio 17 2022" cmake -B . -S ../exple-cmake-build -G"Visual Studio 17 2022"
``` ```
### Choosing a compiler and setting compiler options
To choose a compiler use *CMAKE_CXX_COMPILER* variable when configuring cmake build. For setting options to be passed to compiler during build use *CMAKE_CXX_FLAGS* variable.
If you have *icc* on path, i.e.
```
icc --version
```
returns the version number then you can select it as a compiler for building this project with
```
cmake -B . -S ../exple-cmake-build -DCMAKE_CXX_COMPILER=icc
```
To specify compilation options, e.g. *-fno-align-loops* and *-fno-align-loops*
```
cmake -B . -S ../exple-cmake-build -DCMAKE_CXX_COMPILER=icc -DCMAKE_CXX_FLAGS="-fno-align-loops -fno-align-loops"
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment