1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

Set BUILD_TESTIN to OFF by default when building cpu_features

This commit is contained in:
Carles Fernandez 2021-07-25 14:43:27 +02:00
parent 9e921d161c
commit 63463eee71
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 6 additions and 10 deletions

View File

@ -277,14 +277,7 @@ if(CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH)
if(CpuFeatures_FOUND) if(CpuFeatures_FOUND)
message(STATUS "Found CpuFeatures: (found version ${CpuFeatures_VERSION})") message(STATUS "Found CpuFeatures: (found version ${CpuFeatures_VERSION})")
else() else()
if(BUILD_TESTING)
set(BUILD_TESTING_AUX ${BUILD_TESTING})
endif()
set(BUILD_TESTING OFF)
add_subdirectory(cpu_features) add_subdirectory(cpu_features)
if(BUILD_TESTING_AUX)
set(BUILD_TESTING ${BUILD_TESTING_AUX})
endif()
endif() endif()
set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}") set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
endif() endif()

View File

@ -23,6 +23,9 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE) FORCE)
endif() endif()
# BUILD_TESTING is a standard CMake variable, but we declare it here to make it
# prominent in the GUI.
option(BUILD_TESTING "Enable test (depends on googletest)." OFF)
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
# it prominent in the GUI. # it prominent in the GUI.
# cpu_features uses bit-fields which are - to some extends - implementation-defined (see https://en.cppreference.com/w/c/language/bit_field). # cpu_features uses bit-fields which are - to some extends - implementation-defined (see https://en.cppreference.com/w/c/language/bit_field).

View File

@ -29,10 +29,10 @@ 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 ## Enabling tests
CMake default options for cpu_features is Release built type with tests enabled. CMake default options for cpu_features is Release built type with tests
To disable testing set cmake `BUILD_TESTING` variable to `OFF`, disabled. To enable testing set cmake `BUILD_TESTING` variable to `ON`,
[.travis.yml](https://github.com/google/cpu_features/blob/master/.travis.yml) [.travis.yml](https://github.com/google/cpu_features/blob/master/.travis.yml)
and and
[appveyor.yml](https://github.com/google/cpu_features/blob/master/appveyor.yml) [appveyor.yml](https://github.com/google/cpu_features/blob/master/appveyor.yml)