1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 15:12:30 +02:00

CMake: Enable CXX compiler for tests only (#110)

CMake: Enable CXX compiler for tests only

Co-authored-by: Mizux <mizux.dev@gmail.com>
This commit is contained in:
Nikita Karpey 2020-03-11 18:40:23 +05:00 committed by GitHub
parent b5c271c537
commit ba81cb3da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0)
project(CpuFeatures VERSION 0.1.0)
project(CpuFeatures VERSION 0.1.0 LANGUAGES C)
set(CMAKE_C_STANDARD 99)
@ -161,6 +161,12 @@ include(CTest)
if(BUILD_TESTING)
# Automatically incorporate googletest into the CMake Project if target not
# found.
enable_language(CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) # prefer use of -std11 instead of -gnustd11
if(NOT TARGET gtest OR NOT TARGET gmock_main)
# Download and unpack googletest at configure time.
configure_file(

View File

@ -2,10 +2,6 @@
# libraries for tests
#
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) # prefer use of -std11 instead of -gnustd11
include_directories(../include)
add_definitions(-DCPU_FEATURES_TEST)