mirror of
https://github.com/google/cpu_features.git
synced 2025-04-27 23:22:31 +02:00
Update README.md
This commit is contained in:
parent
06abc90b45
commit
8e5c298d1d
@ -2,27 +2,29 @@
|
|||||||
|
|
||||||
## Recommended usage : Incorporating cpu_features into a CMake project
|
## Recommended usage : Incorporating cpu_features into a CMake project
|
||||||
|
|
||||||
For API / ABI compatibility reasons, it is recommended to build and use
|
For API / ABI compatibility reasons, it is recommended to build and use
|
||||||
cpu_features in a subdirectory of your project or as an embedded dependency.
|
cpu_features in a subdirectory of your project or as an embedded dependency.
|
||||||
|
|
||||||
This is similar to the recommended usage of the googletest framework
|
This is similar to the recommended usage of the googletest framework
|
||||||
( https://github.com/google/googletest/blob/master/googletest/README.md )
|
( https://github.com/google/googletest/blob/master/googletest/README.md )
|
||||||
|
|
||||||
Build and use step-by-step
|
Build and use step-by-step
|
||||||
|
|
||||||
|
|
||||||
1- Download cpu_features and copy it in a sub-directory in your project.
|
1- Download cpu_features and copy it in a sub-directory in your project.
|
||||||
or add cpu_features as a git-submodule in your project
|
or add cpu_features as a git-submodule in your project
|
||||||
|
|
||||||
2- You can then use the cmake command `add_subdirectory()` to include
|
2- You can then use the cmake command `add_subdirectory()` to include
|
||||||
cpu_features directly and use the `cpu_features` target in your project.
|
cpu_features directly and use the `cpu_features` target in your project.
|
||||||
|
|
||||||
3- Add the `cpu_features` target to the `target_link_libraries()` section of
|
3- Add the `cpu_features` target to the `target_link_libraries()` section of
|
||||||
your executable or of your library.
|
your executable or of your library.
|
||||||
|
|
||||||
## Disabling tests
|
## Disabling tests
|
||||||
|
|
||||||
CMake default options for cpu_features is Release built type with tests
|
CMake default options for cpu_features is `Release` built type with tests
|
||||||
enabled. To disable testing set cmake `BUILD_TESTING` variable to `OFF`,
|
enabled. To disable testing set cmake `BUILD_TESTING` variable to `OFF`.
|
||||||
[.travis.yml](../.travis.yml) and [appveyor.yml](../appveyor.yml) have up to
|
e.g.
|
||||||
date examples.
|
```sh
|
||||||
|
cmake -S. -Bbuild -DBUILD_TESTING=OFF
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user