mirror of
https://github.com/google/cpu_features.git
synced 2025-07-02 05:33:17 +02:00
Move ci folder and make naming more consistent (#233)
This commit is contained in:

committed by
GitHub

parent
70ca4fd06f
commit
c219c921c5
22
cmake/ci/sample/CMakeLists.txt
Normal file
22
cmake/ci/sample/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(Sample VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
include(CTest)
|
||||
find_package(CpuFeatures REQUIRED)
|
||||
|
||||
add_executable(sample main.cpp)
|
||||
target_compile_features(sample PUBLIC cxx_std_11)
|
||||
set_target_properties(sample PROPERTIES
|
||||
CXX_STANDARD 11
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
VERSION ${PROJECT_VERSION})
|
||||
target_link_libraries(sample PRIVATE CpuFeatures::cpu_features)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_test(NAME sample_test COMMAND sample)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS sample
|
||||
EXPORT SampleTargets
|
||||
DESTINATION ${CMAKE_INSTALL_BIN_DIR})
|
11
cmake/ci/sample/main.cpp
Normal file
11
cmake/ci/sample/main.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "cpuinfo_x86.h"
|
||||
|
||||
using namespace cpu_features;
|
||||
|
||||
int main(int /*argc*/, char** /*argv*/) {
|
||||
static const X86Features features = GetX86Info().features;
|
||||
std::cout << std::endl;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user