diff --git a/README.md b/README.md index cc41acd53c4bc97a764077c5207b2c780451070f..335437553ae56b13e2a5b1560dd433c984a15b9e 100644 --- a/README.md +++ b/README.md @@ -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" ``` + +### 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" +``` +