common_util
Loading...
Searching...
No Matches
1. Build and Run

1.1. Windows

1.1.1. Modify Scripts

1.1 Set the Generator

Open the ./script/build.bat file and replace the following line:

set generator="Visual Studio 14 2015"

with the corresponding version of Visual Studio installed on your machine. It can be one of the following values:

Visual Studio 14 2015
Visual Studio 15 2017
Visual Studio 16 2019
Visual Studio 17 2022

You can use the cmake -G command to view more supported generators.

1.2 Set the Number of CPU Cores

Open the ./script/build.bat file and replace the following line:

set cpu_cores=6

with the number of CPU cores on your machine.

To check the number of CPU cores:

1. Open cmd, then input:
wmic
2. Input:
cpu get NumberOfCores

1.1.2. Compilation

./script/build.bat build [x86|x64] [release|rls|debug|dbg]
# Debug模式
# ./script/build.bat build dbg
  • Argument 1: Platform type of the target program to build, x86 means 32-bit program, and x64 means 64-bit program.
  • Argument 2: Configuration type of the target program to build, release or rls means the release version, and debug or dbg means the debug version.

1.1.3. Run

Run the results compiled in step 2.

./script/build.bat run

1.1.4. Clean Cache

Clear the cache from the compilation in step 2.

./script/build.bat clean

1.2. Unix-like

Including Linux/macOS and other Unix-like systems.

1.2.1. Compilation

./script/build.sh build [release|rls|debug|dbg]
# Debug模式
# ./script/build.sh build dbg

1.2.2. Run

Run the results compiled in step 1.

./script/build.sh run

1.2.3. Clean Cache

Clear the cache from the compilation in step 1.

./script/build.sh clean