mirror of
https://github.com/google/cpu_features.git
synced 2025-07-01 13:21:13 +02:00
44
README.md
44
README.md
@ -216,23 +216,39 @@ Please check the [CMake build instructions](cmake/README.md).
|
|||||||
<a name="quickstart"></a>
|
<a name="quickstart"></a>
|
||||||
### Quickstart
|
### Quickstart
|
||||||
|
|
||||||
- Run `list_cpu_features`
|
- Run `list_cpu_features`
|
||||||
```sh
|
```sh
|
||||||
cmake -S. -Bbuild -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
|
cmake -S. -Bbuild -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
|
||||||
cmake --build build --config Release -j
|
cmake --build build --config Release -j
|
||||||
./build/list_cpu_features --json
|
./build/list_cpu_features --json
|
||||||
```
|
```
|
||||||
|
|
||||||
_Note_: Use `--target ALL_BUILD` on the second line for `Visual Studio` and `XCode`.
|
_Note_: Use `--target ALL_BUILD` on the second line for `Visual Studio` and `XCode`.
|
||||||
|
|
||||||
- run tests
|
- run tests
|
||||||
```sh
|
```sh
|
||||||
cmake -S. -Bbuild -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
|
cmake -S. -Bbuild -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
|
||||||
cmake --build build --config Debug -j
|
cmake --build build --config Debug -j
|
||||||
cmake --build build --config Debug --target test
|
cmake --build build --config Debug --target test
|
||||||
```
|
```
|
||||||
|
|
||||||
_Note_: Use `--target RUN_TESTS` on the last line for `Visual Studio` and `--target RUN_TEST` for `XCode`.
|
_Note_: Use `--target RUN_TESTS` on the last line for `Visual Studio` and `--target RUN_TEST` for `XCode`.
|
||||||
|
|
||||||
|
|
||||||
|
- install `cpu_features`
|
||||||
|
```sh
|
||||||
|
cmake --build build --config Release --target install -v
|
||||||
|
```
|
||||||
|
|
||||||
|
_Note_: Use `--target INSTALL` for `Visual Studio`.
|
||||||
|
|
||||||
|
_Note_: When using `Makefile` or `XCode` generator, you can use
|
||||||
|
[`DESTDIR`](https://www.gnu.org/software/make/manual/html_node/DESTDIR.html)
|
||||||
|
to install on a local repository.<br>
|
||||||
|
e.g.
|
||||||
|
```sh
|
||||||
|
cmake --build build --config Release --target install -v -- DESTDIR=install
|
||||||
|
```
|
||||||
|
|
||||||
<a name="bindings"></a>
|
<a name="bindings"></a>
|
||||||
## Community bindings
|
## Community bindings
|
||||||
|
@ -17,7 +17,7 @@ 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 `CpuFeature::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
|
||||||
|
5
cmake/ci/vagrant/freebsd/Vagrantfile
vendored
5
cmake/ci/vagrant/freebsd/Vagrantfile
vendored
@ -99,4 +99,9 @@ Vagrant.configure("2") do |config|
|
|||||||
cd project
|
cd project
|
||||||
cmake --build build --target test -v
|
cmake --build build --target test -v
|
||||||
SHELL
|
SHELL
|
||||||
|
config.vm.provision "test", type: "shell", inline:<<-SHELL
|
||||||
|
set -x
|
||||||
|
cd project
|
||||||
|
cmake --build build --target install -v
|
||||||
|
SHELL
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user