Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Dominik Czarnota <dominik.b.czarnota@gmail.com>
Dominik Korman <kormandominik@gmail.com>
Donald Aingworth <donalds_junk_mail@yahoo.com>
Doug Evans <xdje42@gmail.com>
Egor Skryabin <egorskrybin@bk.ru>
Eric Backus <eric_backus@alum.mit.edu>
Eric Fiselier <eric@efcs.ca>
Eugene Zhuk <eugene.zhuk@gmail.com>
Expand Down
11 changes: 8 additions & 3 deletions docs/platform_specific_build_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ On QNX, the pthread library is part of libc and usually included automatically
[`pthread_create()`](https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/p/pthread_create.html)).
There's no separate pthread library to link.

## Building with Visual Studio 2015, 2017 or 2022
## Building on Windows

The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` which reads the registry. Either add `shlwapi.lib` under `[ Configuration Properties > Linker > Input ]`, or use the following:
The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` which reads the registry.
If you are building with Visual Studio (2015, 2017 or 2022) either add `shlwapi.lib` under `[ Configuration Properties > Linker > Input ]`, or use the following:

```
// Alternatively, can add libraries using linker options.
Expand All @@ -33,7 +34,11 @@ The `shlwapi` library (`-lshlwapi`) is required to support a call to `CPUInfo` w
#endif
```

When using the static library, make sure to add `BENCHMARK_STATIC_DEFINE` under `[Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions]`
When using the static library, make sure to add `BENCHMARK_STATIC_DEFINE` (For Visual Studio under `[Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions]`).

When using MingGW GCC toolchain for your project, compilation command might look like this (libbenchmark.a in the same directory as test_benchmark.cpp):

`g++ test_benchmark.cpp -DBENCHMARK_STATIC_DEFINE -isystem "C:\\Program Files\\vcpkg\\installed\\x64-mingw-static\\include" -L "C:\\Program Files\\vcpkg\\installed\\x64-mingw-static\\lib" -lbenchmark -lpthread -o benchmark_test.exe`

Can also use the graphical version of CMake:
* Open `CMake GUI`.
Expand Down
Loading