Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 2 | |
| 3 | INCLUDE(GNUInstallDirs) |
| 4 | |
| 5 | # ---[ Project and semantic versioning. |
Marat Dukhan | 63d41a5 | 2017-10-26 00:37:12 +0000 | [diff] [blame] | 6 | PROJECT(cpuinfo C CXX) |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 7 | |
| 8 | # ---[ Options. |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 9 | OPTION(CPUINFO_BUILD_TOOLS "Build command-line tools" ON) |
Marat Dukhan | cc44bf3 | 2017-12-18 17:45:48 -0800 | [diff] [blame] | 10 | OPTION(CPUINFO_BUILD_UNIT_TESTS "Build cpuinfo unit tests" ON) |
| 11 | OPTION(CPUINFO_BUILD_MOCK_TESTS "Build cpuinfo mock tests" ON) |
| 12 | OPTION(CPUINFO_BUILD_BENCHMARKS "Build cpuinfo micro-benchmarks" ON) |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 13 | |
| 14 | # ---[ CMake options |
| 15 | IF(CPUINFO_BUILD_UNIT_TESTS OR CPUINFO_BUILD_MOCK_TESTS) |
| 16 | ENABLE_TESTING() |
| 17 | ENDIF() |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 18 | |
| 19 | # ---[ Build flags |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 20 | IF(NOT MSVC) |
Marat Dukhan | 7b73888 | 2017-10-18 16:59:28 -0700 | [diff] [blame] | 21 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") |
| 22 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 23 | ENDIF() |
| 24 | |
| 25 | IF(NOT CMAKE_SYSTEM_PROCESSOR) |
| 26 | MESSAGE(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR not defined") |
Marat Dukhan | 7b73888 | 2017-10-18 16:59:28 -0700 | [diff] [blame] | 27 | ELSEIF(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64|armv5te|armv7|armv7f|armv7s|armv7k|armv7-a|armv7l|arm64|aarch64)$") |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 28 | MESSAGE(FATAL_ERROR "Unrecognized CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}") |
| 29 | ENDIF() |
| 30 | |
| 31 | IF(NOT CMAKE_SYSTEM_NAME) |
| 32 | MESSAGE(FATAL_ERROR "CMAKE_SYSTEM_NAME not defined") |
| 33 | ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Darwin|Linux|Android)$") |
| 34 | MESSAGE(FATAL_ERROR "Unrecognized CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") |
| 35 | ENDIF() |
| 36 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 37 | # ---[ Download deps |
| 38 | SET(CONFU_DEPENDENCIES_SOURCE_DIR ${CMAKE_SOURCE_DIR}/deps |
| 39 | CACHE PATH "Confu-style dependencies source directory") |
| 40 | SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps |
| 41 | CACHE PATH "Confu-style dependencies binary directory") |
| 42 | |
| 43 | IF(NOT TARGET gtest) |
| 44 | CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt") |
| 45 | EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . |
| 46 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download") |
| 47 | EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build . |
| 48 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download") |
| 49 | ENDIF() |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 50 | |
Marat Dukhan | cc44bf3 | 2017-12-18 17:45:48 -0800 | [diff] [blame] | 51 | IF(NOT TARGET benchmark) |
| 52 | CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CMAKE_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt") |
| 53 | EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . |
| 54 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googlebenchmark-download") |
| 55 | EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build . |
| 56 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googlebenchmark-download") |
| 57 | ENDIF() |
| 58 | |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 59 | # ---[ cpuinfo library |
| 60 | SET(CPUINFO_SRCS |
| 61 | src/init.c |
| 62 | src/api.c |
| 63 | src/log.c) |
| 64 | |
| 65 | IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$") |
| 66 | LIST(APPEND CPUINFO_SRCS |
| 67 | src/x86/init.c |
| 68 | src/x86/info.c |
| 69 | src/x86/vendor.c |
| 70 | src/x86/uarch.c |
| 71 | src/x86/name.c |
| 72 | src/x86/topology.c |
| 73 | src/x86/isa.c |
| 74 | src/x86/cache/init.c |
| 75 | src/x86/cache/descriptor.c |
| 76 | src/x86/cache/deterministic.c) |
| 77 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 78 | LIST(APPEND CPUINFO_SRCS |
| 79 | src/x86/linux/init.c |
| 80 | src/x86/linux/cpuinfo.c) |
| 81 | ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin") |
| 82 | LIST(APPEND CPUINFO_SRCS src/x86/mach/init.c) |
| 83 | ENDIF() |
Marat Dukhan | 7b73888 | 2017-10-18 16:59:28 -0700 | [diff] [blame] | 84 | ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7|armv7f|armv7s|armv7k|armv7-a|armv7l|arm64|aarch64)$") |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 85 | LIST(APPEND CPUINFO_SRCS |
| 86 | src/arm/uarch.c |
| 87 | src/arm/cache.c) |
| 88 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 89 | LIST(APPEND CPUINFO_SRCS |
| 90 | src/arm/linux/init.c |
| 91 | src/arm/linux/cpuinfo.c |
| 92 | src/arm/linux/clusters.c |
Marat Dukhan | ed27213 | 2017-10-15 21:55:45 +0000 | [diff] [blame] | 93 | src/arm/linux/chipset.c |
Marat Dukhan | 63a7a6b | 2017-11-29 15:11:56 -0800 | [diff] [blame] | 94 | src/arm/linux/midr.c |
| 95 | src/arm/linux/hwcap.c) |
Marat Dukhan | 3985cf8 | 2017-12-18 18:58:26 -0800 | [diff] [blame^] | 96 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 97 | LIST(APPEND CPUINFO_SRCS src/arm/android/gpu.c) |
| 98 | ENDIF() |
Marat Dukhan | 7b73888 | 2017-10-18 16:59:28 -0700 | [diff] [blame] | 99 | IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7l|armv7-a)$") |
Marat Dukhan | deaa898 | 2017-11-28 11:07:11 -0800 | [diff] [blame] | 100 | LIST(APPEND CPUINFO_SRCS src/arm/linux/aarch32-isa.c) |
Marat Dukhan | 7b73888 | 2017-10-18 16:59:28 -0700 | [diff] [blame] | 101 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND ANDROID_ABI STREQUAL "armeabi") |
Marat Dukhan | deaa898 | 2017-11-28 11:07:11 -0800 | [diff] [blame] | 102 | SET_SOURCE_FILES_PROPERTIES(src/arm/linux/aarch32-isa.c PROPERTIES COMPILE_FLAGS -marm) |
Marat Dukhan | 7b73888 | 2017-10-18 16:59:28 -0700 | [diff] [blame] | 103 | ENDIF() |
| 104 | ELSEIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") |
Marat Dukhan | deaa898 | 2017-11-28 11:07:11 -0800 | [diff] [blame] | 105 | LIST(APPEND CPUINFO_SRCS src/arm/linux/aarch64-isa.c) |
Marat Dukhan | 7b73888 | 2017-10-18 16:59:28 -0700 | [diff] [blame] | 106 | ENDIF() |
| 107 | ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin") |
Marat Dukhan | ad1ac95 | 2017-10-23 15:32:25 -0700 | [diff] [blame] | 108 | LIST(APPEND CPUINFO_SRCS |
| 109 | src/arm/mach/init.c |
| 110 | src/gpu/gles-ios.m) |
Marat Dukhan | 0252701 | 2017-10-23 16:03:05 -0700 | [diff] [blame] | 111 | SET_SOURCE_FILES_PROPERTIES(src/gpu/gles-ios.m PROPERTIES COMPILE_FLAGS -fobjc-arc) |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 112 | ENDIF() |
| 113 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 114 | LIST(APPEND CPUINFO_SRCS |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 115 | src/arm/Android/properties.c) |
| 116 | ENDIF() |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 117 | ENDIF() |
| 118 | |
| 119 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 120 | LIST(APPEND CPUINFO_SRCS |
| 121 | src/linux/smallfile.c |
| 122 | src/linux/multiline.c |
| 123 | src/linux/current.c |
| 124 | src/linux/cpulist.c |
| 125 | src/linux/processors.c) |
| 126 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android") |
Marat Dukhan | fd0f3ef | 2017-12-18 17:45:18 -0800 | [diff] [blame] | 127 | LIST(APPEND CPUINFO_SRCS |
| 128 | src/gpu/gles2.c |
| 129 | src/linux/gpu.c) |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 130 | ENDIF() |
| 131 | ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin") |
| 132 | LIST(APPEND CPUINFO_SRCS src/mach/topology.c) |
| 133 | ENDIF() |
| 134 | |
Marat Dukhan | bfff348 | 2017-10-15 22:24:32 +0000 | [diff] [blame] | 135 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 136 | SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
| 137 | SET(THREADS_PREFER_PTHREAD_FLAG TRUE) |
| 138 | FIND_PACKAGE(Threads REQUIRED) |
| 139 | ENDIF() |
| 140 | |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 141 | ADD_LIBRARY(cpuinfo ${CPUINFO_SRCS}) |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 142 | SET_TARGET_PROPERTIES(cpuinfo PROPERTIES PUBLIC_HEADER include/cpuinfo.h) |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 143 | TARGET_INCLUDE_DIRECTORIES(cpuinfo PUBLIC include) |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 144 | TARGET_INCLUDE_DIRECTORIES(cpuinfo PRIVATE src) |
Marat Dukhan | bfff348 | 2017-10-15 22:24:32 +0000 | [diff] [blame] | 145 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 146 | TARGET_LINK_LIBRARIES(cpuinfo PUBLIC ${CMAKE_THREAD_LIBS_INIT}) |
| 147 | ENDIF() |
Marat Dukhan | e029fd4 | 2017-10-26 00:35:46 +0000 | [diff] [blame] | 148 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 149 | TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE -D_GNU_SOURCE) |
| 150 | ENDIF() |
Marat Dukhan | ad1ac95 | 2017-10-23 15:32:25 -0700 | [diff] [blame] | 151 | IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7|armv7f|armv7s|armv7k|arm64)$") |
| 152 | TARGET_LINK_LIBRARIES(cpuinfo INTERFACE "-framework OpenGLES") |
| 153 | TARGET_LINK_LIBRARIES(cpuinfo INTERFACE "-framework Foundation") |
| 154 | ENDIF() |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 155 | |
| 156 | INSTALL(TARGETS cpuinfo |
| 157 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 158 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 159 | PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) |
| 160 | |
Marat Dukhan | cc44bf3 | 2017-12-18 17:45:48 -0800 | [diff] [blame] | 161 | # ---[ cpuinfo micro-benchmarks |
| 162 | IF(CPUINFO_BUILD_BENCHMARKS) |
| 163 | # ---[ Build google benchmark |
| 164 | IF(NOT TARGET benchmark) |
| 165 | SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "") |
| 166 | ADD_SUBDIRECTORY( |
| 167 | "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark" |
| 168 | "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark") |
| 169 | ENDIF() |
| 170 | |
| 171 | IF(CMAKE_SYSTEM_NAME MATCHES "^(Linux|Android)$") |
| 172 | ADD_EXECUTABLE(get-current-bench bench/get-current.cc) |
| 173 | TARGET_LINK_LIBRARIES(get-current-bench cpuinfo benchmark) |
| 174 | ENDIF() |
| 175 | |
| 176 | ADD_EXECUTABLE(init-bench bench/init.cc) |
| 177 | TARGET_LINK_LIBRARIES(init-bench cpuinfo benchmark) |
| 178 | ENDIF() |
| 179 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 180 | IF(CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS) |
| 181 | # ---[ Build google test |
| 182 | IF(NOT TARGET gtest) |
| 183 | SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
| 184 | ADD_SUBDIRECTORY( |
| 185 | "${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest" |
| 186 | "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest") |
| 187 | ENDIF() |
| 188 | ENDIF() |
| 189 | |
| 190 | # ---[ cpuinfo mock library and mock tests |
| 191 | IF(CPUINFO_BUILD_MOCK_TESTS) |
Marat Dukhan | b8a8337 | 2017-10-13 21:07:44 -0400 | [diff] [blame] | 192 | SET(CPUINFO_MOCK_SRCS "${CPUINFO_SRCS}") |
Marat Dukhan | fd0f3ef | 2017-12-18 17:45:18 -0800 | [diff] [blame] | 193 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 194 | LIST(REMOVE_ITEM CPUINFO_MOCK_SRCS src/gpu/gles2.c) |
| 195 | LIST(APPEND CPUINFO_MOCK_SRCS src/gpu/gles2-mock.c) |
| 196 | ENDIF() |
Marat Dukhan | 1b47462 | 2017-12-18 17:52:40 -0800 | [diff] [blame] | 197 | IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$") |
| 198 | LIST(APPEND CPUINFO_MOCK_SRCS src/x86/mockcpuid.c) |
| 199 | ENDIF() |
Marat Dukhan | b8a8337 | 2017-10-13 21:07:44 -0400 | [diff] [blame] | 200 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 201 | LIST(APPEND CPUINFO_MOCK_SRCS src/linux/mockfile.c) |
| 202 | ENDIF() |
| 203 | |
| 204 | ADD_LIBRARY(cpuinfo_mock ${CPUINFO_MOCK_SRCS}) |
Marat Dukhan | b8a8337 | 2017-10-13 21:07:44 -0400 | [diff] [blame] | 205 | SET_TARGET_PROPERTIES(cpuinfo_mock PROPERTIES PUBLIC_HEADER include/cpuinfo.h) |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 206 | TARGET_INCLUDE_DIRECTORIES(cpuinfo_mock PUBLIC include) |
Marat Dukhan | b8a8337 | 2017-10-13 21:07:44 -0400 | [diff] [blame] | 207 | TARGET_INCLUDE_DIRECTORIES(cpuinfo_mock PRIVATE src) |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 208 | TARGET_COMPILE_DEFINITIONS(cpuinfo_mock PUBLIC "-DCPUINFO_MOCK=1") |
Marat Dukhan | bfff348 | 2017-10-15 22:24:32 +0000 | [diff] [blame] | 209 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 210 | TARGET_LINK_LIBRARIES(cpuinfo_mock PUBLIC ${CMAKE_THREAD_LIBS_INIT}) |
| 211 | ENDIF() |
Marat Dukhan | e029fd4 | 2017-10-26 00:35:46 +0000 | [diff] [blame] | 212 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
| 213 | TARGET_COMPILE_DEFINITIONS(cpuinfo_mock PRIVATE -D_GNU_SOURCE) |
| 214 | ENDIF() |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 215 | |
| 216 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a)$") |
Marat Dukhan | f18db83 | 2017-11-28 11:10:10 -0800 | [diff] [blame] | 217 | ADD_EXECUTABLE(atm7029b-tablet-test test/mock/atm7029b-tablet.cc) |
| 218 | TARGET_INCLUDE_DIRECTORIES(atm7029b-tablet-test PRIVATE test/mock) |
| 219 | TARGET_LINK_LIBRARIES(atm7029b-tablet-test PRIVATE cpuinfo_mock gtest) |
| 220 | ADD_TEST(atm7029b-tablet-test atm7029b-tablet-test) |
| 221 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 222 | ADD_EXECUTABLE(blu-r1-hd-test test/mock/blu-r1-hd.cc) |
| 223 | TARGET_INCLUDE_DIRECTORIES(blu-r1-hd-test PRIVATE test/mock) |
| 224 | TARGET_LINK_LIBRARIES(blu-r1-hd-test PRIVATE cpuinfo_mock gtest) |
| 225 | ADD_TEST(blu-r1-hd-test blu-r1-hd-test) |
| 226 | |
Marat Dukhan | 94f763a | 2017-12-04 16:44:33 -0800 | [diff] [blame] | 227 | ADD_EXECUTABLE(galaxy-a3-2016-eu-test test/mock/galaxy-a3-2016-eu.cc) |
| 228 | TARGET_INCLUDE_DIRECTORIES(galaxy-a3-2016-eu-test PRIVATE test/mock) |
| 229 | TARGET_LINK_LIBRARIES(galaxy-a3-2016-eu-test PRIVATE cpuinfo_mock gtest) |
| 230 | ADD_TEST(galaxy-a3-2016-eu-test galaxy-a3-2016-eu-test) |
| 231 | |
Marat Dukhan | f9ccfa3 | 2017-11-27 15:50:06 -0800 | [diff] [blame] | 232 | ADD_EXECUTABLE(galaxy-a8-2016-duos-test test/mock/galaxy-a8-2016-duos.cc) |
| 233 | TARGET_INCLUDE_DIRECTORIES(galaxy-a8-2016-duos-test PRIVATE test/mock) |
| 234 | TARGET_LINK_LIBRARIES(galaxy-a8-2016-duos-test PRIVATE cpuinfo_mock gtest) |
| 235 | ADD_TEST(galaxy-a8-2016-duos-test galaxy-a8-2016-duos-test) |
| 236 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 237 | ADD_EXECUTABLE(galaxy-grand-prime-value-edition-test test/mock/galaxy-grand-prime-value-edition.cc) |
| 238 | TARGET_INCLUDE_DIRECTORIES(galaxy-grand-prime-value-edition-test PRIVATE test/mock) |
| 239 | TARGET_LINK_LIBRARIES(galaxy-grand-prime-value-edition-test PRIVATE cpuinfo_mock gtest) |
| 240 | ADD_TEST(galaxy-grand-prime-value-edition-test galaxy-grand-prime-value-edition-test) |
| 241 | |
Marat Dukhan | 126c46d | 2017-12-04 16:24:48 -0800 | [diff] [blame] | 242 | ADD_EXECUTABLE(galaxy-j5-test test/mock/galaxy-j5.cc) |
| 243 | TARGET_INCLUDE_DIRECTORIES(galaxy-j5-test PRIVATE test/mock) |
| 244 | TARGET_LINK_LIBRARIES(galaxy-j5-test PRIVATE cpuinfo_mock gtest) |
| 245 | ADD_TEST(galaxy-j5-test galaxy-j5-test) |
| 246 | |
Marat Dukhan | 8443590 | 2017-11-29 15:53:58 -0800 | [diff] [blame] | 247 | ADD_EXECUTABLE(galaxy-j7-prime-test test/mock/galaxy-j7-prime.cc) |
| 248 | TARGET_INCLUDE_DIRECTORIES(galaxy-j7-prime-test PRIVATE test/mock) |
| 249 | TARGET_LINK_LIBRARIES(galaxy-j7-prime-test PRIVATE cpuinfo_mock gtest) |
| 250 | ADD_TEST(galaxy-j7-prime-test galaxy-j7-prime-test) |
| 251 | |
Marat Dukhan | 0d2aaa7 | 2017-11-29 15:48:46 -0800 | [diff] [blame] | 252 | ADD_EXECUTABLE(galaxy-j7-tmobile-test test/mock/galaxy-j7-tmobile.cc) |
| 253 | TARGET_INCLUDE_DIRECTORIES(galaxy-j7-tmobile-test PRIVATE test/mock) |
| 254 | TARGET_LINK_LIBRARIES(galaxy-j7-tmobile-test PRIVATE cpuinfo_mock gtest) |
| 255 | ADD_TEST(galaxy-j7-tmobile-test galaxy-j7-tmobile-test) |
| 256 | |
| 257 | ADD_EXECUTABLE(galaxy-j7-uae-test test/mock/galaxy-j7-uae.cc) |
| 258 | TARGET_INCLUDE_DIRECTORIES(galaxy-j7-uae-test PRIVATE test/mock) |
| 259 | TARGET_LINK_LIBRARIES(galaxy-j7-uae-test PRIVATE cpuinfo_mock gtest) |
| 260 | ADD_TEST(galaxy-j7-uae-test galaxy-j7-uae-test) |
| 261 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 262 | ADD_EXECUTABLE(galaxy-s3-us-test test/mock/galaxy-s3-us.cc) |
| 263 | TARGET_INCLUDE_DIRECTORIES(galaxy-s3-us-test PRIVATE test/mock) |
| 264 | TARGET_LINK_LIBRARIES(galaxy-s3-us-test PRIVATE cpuinfo_mock gtest) |
| 265 | ADD_TEST(galaxy-s3-us-test galaxy-s3-us-test) |
| 266 | |
| 267 | ADD_EXECUTABLE(galaxy-s4-us-test test/mock/galaxy-s4-us.cc) |
| 268 | TARGET_INCLUDE_DIRECTORIES(galaxy-s4-us-test PRIVATE test/mock) |
| 269 | TARGET_LINK_LIBRARIES(galaxy-s4-us-test PRIVATE cpuinfo_mock gtest) |
| 270 | ADD_TEST(galaxy-s4-us-test galaxy-s4-us-test) |
| 271 | |
| 272 | ADD_EXECUTABLE(galaxy-s5-global-test test/mock/galaxy-s5-global.cc) |
| 273 | TARGET_INCLUDE_DIRECTORIES(galaxy-s5-global-test PRIVATE test/mock) |
| 274 | TARGET_LINK_LIBRARIES(galaxy-s5-global-test PRIVATE cpuinfo_mock gtest) |
| 275 | ADD_TEST(galaxy-s5-global-test galaxy-s5-global-test) |
| 276 | |
| 277 | ADD_EXECUTABLE(galaxy-s5-us-test test/mock/galaxy-s5-us.cc) |
| 278 | TARGET_INCLUDE_DIRECTORIES(galaxy-s5-us-test PRIVATE test/mock) |
| 279 | TARGET_LINK_LIBRARIES(galaxy-s5-us-test PRIVATE cpuinfo_mock gtest) |
| 280 | ADD_TEST(galaxy-s5-us-test galaxy-s5-us-test) |
| 281 | |
| 282 | ADD_EXECUTABLE(galaxy-tab-3-7.0-test test/mock/galaxy-tab-3-7.0.cc) |
| 283 | TARGET_INCLUDE_DIRECTORIES(galaxy-tab-3-7.0-test PRIVATE test/mock) |
| 284 | TARGET_LINK_LIBRARIES(galaxy-tab-3-7.0-test PRIVATE cpuinfo_mock gtest) |
| 285 | ADD_TEST(galaxy-tab-3-7.0-test galaxy-tab-3-7.0-test) |
| 286 | |
| 287 | ADD_EXECUTABLE(galaxy-tab-3-lite-test test/mock/galaxy-tab-3-lite.cc) |
| 288 | TARGET_INCLUDE_DIRECTORIES(galaxy-tab-3-lite-test PRIVATE test/mock) |
| 289 | TARGET_LINK_LIBRARIES(galaxy-tab-3-lite-test PRIVATE cpuinfo_mock gtest) |
| 290 | ADD_TEST(galaxy-tab-3-lite-test galaxy-tab-3-lite-test) |
| 291 | |
| 292 | ADD_EXECUTABLE(galaxy-win-duos-test test/mock/galaxy-win-duos.cc) |
| 293 | TARGET_INCLUDE_DIRECTORIES(galaxy-win-duos-test PRIVATE test/mock) |
| 294 | TARGET_LINK_LIBRARIES(galaxy-win-duos-test PRIVATE cpuinfo_mock gtest) |
| 295 | ADD_TEST(galaxy-win-duos-test galaxy-win-duos-test) |
| 296 | |
| 297 | ADD_EXECUTABLE(huawei-ascend-p7-test test/mock/huawei-ascend-p7.cc) |
| 298 | TARGET_INCLUDE_DIRECTORIES(huawei-ascend-p7-test PRIVATE test/mock) |
| 299 | TARGET_LINK_LIBRARIES(huawei-ascend-p7-test PRIVATE cpuinfo_mock gtest) |
| 300 | ADD_TEST(huawei-ascend-p7-test huawei-ascend-p7-test) |
| 301 | |
| 302 | ADD_EXECUTABLE(lenovo-a6600-plus-test test/mock/lenovo-a6600-plus.cc) |
| 303 | TARGET_INCLUDE_DIRECTORIES(lenovo-a6600-plus-test PRIVATE test/mock) |
| 304 | TARGET_LINK_LIBRARIES(lenovo-a6600-plus-test PRIVATE cpuinfo_mock gtest) |
| 305 | ADD_TEST(lenovo-a6600-plus-test lenovo-a6600-plus-test) |
| 306 | |
| 307 | ADD_EXECUTABLE(lenovo-vibe-x2-test test/mock/lenovo-vibe-x2.cc) |
| 308 | TARGET_INCLUDE_DIRECTORIES(lenovo-vibe-x2-test PRIVATE test/mock) |
| 309 | TARGET_LINK_LIBRARIES(lenovo-vibe-x2-test PRIVATE cpuinfo_mock gtest) |
| 310 | ADD_TEST(lenovo-vibe-x2-test lenovo-vibe-x2-test) |
| 311 | |
| 312 | ADD_EXECUTABLE(lg-k10-eu-test test/mock/lg-k10-eu.cc) |
| 313 | TARGET_INCLUDE_DIRECTORIES(lg-k10-eu-test PRIVATE test/mock) |
| 314 | TARGET_LINK_LIBRARIES(lg-k10-eu-test PRIVATE cpuinfo_mock gtest) |
| 315 | ADD_TEST(lg-k10-eu-test lg-k10-eu-test) |
| 316 | |
| 317 | ADD_EXECUTABLE(moto-e-gen1-test test/mock/moto-e-gen1.cc) |
| 318 | TARGET_INCLUDE_DIRECTORIES(moto-e-gen1-test PRIVATE test/mock) |
| 319 | TARGET_LINK_LIBRARIES(moto-e-gen1-test PRIVATE cpuinfo_mock gtest) |
| 320 | ADD_TEST(moto-e-gen1-test moto-e-gen1-test) |
| 321 | |
| 322 | ADD_EXECUTABLE(moto-g-gen2-test test/mock/moto-g-gen2.cc) |
| 323 | TARGET_INCLUDE_DIRECTORIES(moto-g-gen2-test PRIVATE test/mock) |
| 324 | TARGET_LINK_LIBRARIES(moto-g-gen2-test PRIVATE cpuinfo_mock gtest) |
| 325 | ADD_TEST(moto-g-gen2-test moto-g-gen2-test) |
| 326 | |
| 327 | ADD_EXECUTABLE(moto-g-gen3-test test/mock/moto-g-gen3.cc) |
| 328 | TARGET_INCLUDE_DIRECTORIES(moto-g-gen3-test PRIVATE test/mock) |
| 329 | TARGET_LINK_LIBRARIES(moto-g-gen3-test PRIVATE cpuinfo_mock gtest) |
| 330 | ADD_TEST(moto-g-gen3-test moto-g-gen3-test) |
| 331 | |
| 332 | ADD_EXECUTABLE(nexus-s-test test/mock/nexus-s.cc) |
| 333 | TARGET_INCLUDE_DIRECTORIES(nexus-s-test PRIVATE test/mock) |
| 334 | TARGET_LINK_LIBRARIES(nexus-s-test PRIVATE cpuinfo_mock gtest) |
| 335 | ADD_TEST(nexus-s-test nexus-s-test) |
| 336 | |
| 337 | ADD_EXECUTABLE(nexus4-test test/mock/nexus4.cc) |
| 338 | TARGET_INCLUDE_DIRECTORIES(nexus4-test PRIVATE test/mock) |
| 339 | TARGET_LINK_LIBRARIES(nexus4-test PRIVATE cpuinfo_mock gtest) |
| 340 | ADD_TEST(nexus4-test nexus4-test) |
| 341 | |
| 342 | ADD_EXECUTABLE(nexus6-test test/mock/nexus6.cc) |
| 343 | TARGET_INCLUDE_DIRECTORIES(nexus6-test PRIVATE test/mock) |
| 344 | TARGET_LINK_LIBRARIES(nexus6-test PRIVATE cpuinfo_mock gtest) |
| 345 | ADD_TEST(nexus6-test nexus6-test) |
| 346 | |
Marat Dukhan | 5957254 | 2017-11-27 17:22:09 -0800 | [diff] [blame] | 347 | ADD_EXECUTABLE(padcod-10.1-test test/mock/padcod-10.1.cc) |
| 348 | TARGET_INCLUDE_DIRECTORIES(padcod-10.1-test PRIVATE test/mock) |
| 349 | TARGET_LINK_LIBRARIES(padcod-10.1-test PRIVATE cpuinfo_mock gtest) |
| 350 | ADD_TEST(padcod-10.1-test padcod-10.1-test) |
| 351 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 352 | ADD_EXECUTABLE(xiaomi-redmi-2a-test test/mock/xiaomi-redmi-2a.cc) |
| 353 | TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-2a-test PRIVATE test/mock) |
| 354 | TARGET_LINK_LIBRARIES(xiaomi-redmi-2a-test PRIVATE cpuinfo_mock gtest) |
| 355 | ADD_TEST(xiaomi-redmi-2a-test xiaomi-redmi-2a-test) |
Marat Dukhan | ad74184 | 2017-12-03 23:11:46 -0800 | [diff] [blame] | 356 | |
| 357 | ADD_EXECUTABLE(xperia-sl-test test/mock/xperia-sl.cc) |
| 358 | TARGET_INCLUDE_DIRECTORIES(xperia-sl-test PRIVATE test/mock) |
| 359 | TARGET_LINK_LIBRARIES(xperia-sl-test PRIVATE cpuinfo_mock gtest) |
| 360 | ADD_TEST(xperia-sl-test xperia-sl-test) |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 361 | ENDIF() |
| 362 | |
| 363 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a|aarch64)$") |
| 364 | ADD_EXECUTABLE(galaxy-c9-pro-test test/mock/galaxy-c9-pro.cc) |
| 365 | TARGET_INCLUDE_DIRECTORIES(galaxy-c9-pro-test PRIVATE test/mock) |
| 366 | TARGET_LINK_LIBRARIES(galaxy-c9-pro-test PRIVATE cpuinfo_mock gtest) |
| 367 | ADD_TEST(galaxy-c9-pro-test galaxy-c9-pro-test) |
| 368 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 369 | ADD_EXECUTABLE(galaxy-s6-test test/mock/galaxy-s6.cc) |
| 370 | TARGET_INCLUDE_DIRECTORIES(galaxy-s6-test PRIVATE test/mock) |
| 371 | TARGET_LINK_LIBRARIES(galaxy-s6-test PRIVATE cpuinfo_mock gtest) |
| 372 | ADD_TEST(galaxy-s6-test galaxy-s6-test) |
| 373 | |
| 374 | ADD_EXECUTABLE(galaxy-s7-us-test test/mock/galaxy-s7-us.cc) |
| 375 | TARGET_INCLUDE_DIRECTORIES(galaxy-s7-us-test PRIVATE test/mock) |
| 376 | TARGET_LINK_LIBRARIES(galaxy-s7-us-test PRIVATE cpuinfo_mock gtest) |
| 377 | ADD_TEST(galaxy-s7-us-test galaxy-s7-us-test) |
| 378 | |
| 379 | ADD_EXECUTABLE(galaxy-s7-global-test test/mock/galaxy-s7-global.cc) |
| 380 | TARGET_INCLUDE_DIRECTORIES(galaxy-s7-global-test PRIVATE test/mock) |
| 381 | TARGET_LINK_LIBRARIES(galaxy-s7-global-test PRIVATE cpuinfo_mock gtest) |
| 382 | ADD_TEST(galaxy-s7-global-test galaxy-s7-global-test) |
| 383 | |
| 384 | ADD_EXECUTABLE(galaxy-s8-us-test test/mock/galaxy-s8-us.cc) |
| 385 | TARGET_INCLUDE_DIRECTORIES(galaxy-s8-us-test PRIVATE test/mock) |
| 386 | TARGET_LINK_LIBRARIES(galaxy-s8-us-test PRIVATE cpuinfo_mock gtest) |
| 387 | ADD_TEST(galaxy-s8-us-test galaxy-s8-us-test) |
| 388 | |
| 389 | ADD_EXECUTABLE(galaxy-s8-global-test test/mock/galaxy-s8-global.cc) |
| 390 | TARGET_INCLUDE_DIRECTORIES(galaxy-s8-global-test PRIVATE test/mock) |
| 391 | TARGET_LINK_LIBRARIES(galaxy-s8-global-test PRIVATE cpuinfo_mock gtest) |
| 392 | ADD_TEST(galaxy-s8-global-test galaxy-s8-global-test) |
| 393 | |
Marat Dukhan | cd98c28 | 2017-11-29 16:10:26 -0800 | [diff] [blame] | 394 | ADD_EXECUTABLE(huawei-p8-lite-test test/mock/huawei-p8-lite.cc) |
| 395 | TARGET_INCLUDE_DIRECTORIES(huawei-p8-lite-test PRIVATE test/mock) |
| 396 | TARGET_LINK_LIBRARIES(huawei-p8-lite-test PRIVATE cpuinfo_mock gtest) |
| 397 | ADD_TEST(huawei-p8-lite-test huawei-p8-lite-test) |
| 398 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 399 | ADD_EXECUTABLE(huawei-p9-lite-test test/mock/huawei-p9-lite.cc) |
| 400 | TARGET_INCLUDE_DIRECTORIES(huawei-p9-lite-test PRIVATE test/mock) |
| 401 | TARGET_LINK_LIBRARIES(huawei-p9-lite-test PRIVATE cpuinfo_mock gtest) |
| 402 | ADD_TEST(huawei-p9-lite-test huawei-p9-lite-test) |
| 403 | |
| 404 | ADD_EXECUTABLE(huawei-mate-8-test test/mock/huawei-mate-8.cc) |
| 405 | TARGET_INCLUDE_DIRECTORIES(huawei-mate-8-test PRIVATE test/mock) |
| 406 | TARGET_LINK_LIBRARIES(huawei-mate-8-test PRIVATE cpuinfo_mock gtest) |
| 407 | ADD_TEST(huawei-mate-8-test huawei-mate-8-test) |
| 408 | |
| 409 | ADD_EXECUTABLE(huawei-mate-9-test test/mock/huawei-mate-9.cc) |
| 410 | TARGET_INCLUDE_DIRECTORIES(huawei-mate-9-test PRIVATE test/mock) |
| 411 | TARGET_LINK_LIBRARIES(huawei-mate-9-test PRIVATE cpuinfo_mock gtest) |
| 412 | ADD_TEST(huawei-mate-9-test huawei-mate-9-test) |
| 413 | |
Marat Dukhan | 7be1140 | 2017-11-27 14:57:02 -0800 | [diff] [blame] | 414 | ADD_EXECUTABLE(huawei-mate-10-test test/mock/huawei-mate-10.cc) |
| 415 | TARGET_INCLUDE_DIRECTORIES(huawei-mate-10-test PRIVATE test/mock) |
| 416 | TARGET_LINK_LIBRARIES(huawei-mate-10-test PRIVATE cpuinfo_mock gtest) |
| 417 | ADD_TEST(huawei-mate-10-test huawei-mate-10-test) |
| 418 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 419 | ADD_EXECUTABLE(meizu-pro-6-test test/mock/meizu-pro-6.cc) |
| 420 | TARGET_INCLUDE_DIRECTORIES(meizu-pro-6-test PRIVATE test/mock) |
| 421 | TARGET_LINK_LIBRARIES(meizu-pro-6-test PRIVATE cpuinfo_mock gtest) |
| 422 | ADD_TEST(meizu-pro-6-test meizu-pro-6-test) |
| 423 | |
| 424 | ADD_EXECUTABLE(meizu-pro-6s-test test/mock/meizu-pro-6s.cc) |
| 425 | TARGET_INCLUDE_DIRECTORIES(meizu-pro-6s-test PRIVATE test/mock) |
| 426 | TARGET_LINK_LIBRARIES(meizu-pro-6s-test PRIVATE cpuinfo_mock gtest) |
| 427 | ADD_TEST(meizu-pro-6s-test meizu-pro-6s-test) |
| 428 | |
| 429 | ADD_EXECUTABLE(meizu-pro-7-plus-test test/mock/meizu-pro-7-plus.cc) |
| 430 | TARGET_INCLUDE_DIRECTORIES(meizu-pro-7-plus-test PRIVATE test/mock) |
| 431 | TARGET_LINK_LIBRARIES(meizu-pro-7-plus-test PRIVATE cpuinfo_mock gtest) |
| 432 | ADD_TEST(meizu-pro-7-plus-test meizu-pro-7-plus-test) |
| 433 | |
| 434 | ADD_EXECUTABLE(nexus5x-test test/mock/nexus5x.cc) |
| 435 | TARGET_INCLUDE_DIRECTORIES(nexus5x-test PRIVATE test/mock) |
| 436 | TARGET_LINK_LIBRARIES(nexus5x-test PRIVATE cpuinfo_mock gtest) |
| 437 | ADD_TEST(nexus5x-test nexus5x-test) |
| 438 | |
| 439 | ADD_EXECUTABLE(nexus6p-test test/mock/nexus6p.cc) |
| 440 | TARGET_INCLUDE_DIRECTORIES(nexus6p-test PRIVATE test/mock) |
| 441 | TARGET_LINK_LIBRARIES(nexus6p-test PRIVATE cpuinfo_mock gtest) |
| 442 | ADD_TEST(nexus6p-test nexus6p-test) |
| 443 | |
| 444 | ADD_EXECUTABLE(nexus9-test test/mock/nexus9.cc) |
| 445 | TARGET_INCLUDE_DIRECTORIES(nexus9-test PRIVATE test/mock) |
| 446 | TARGET_LINK_LIBRARIES(nexus9-test PRIVATE cpuinfo_mock gtest) |
| 447 | ADD_TEST(nexus9-test nexus9-test) |
| 448 | |
Marat Dukhan | 75dd8a1 | 2017-12-04 15:43:02 -0800 | [diff] [blame] | 449 | ADD_EXECUTABLE(oppo-a37-test test/mock/oppo-a37.cc) |
| 450 | TARGET_INCLUDE_DIRECTORIES(oppo-a37-test PRIVATE test/mock) |
| 451 | TARGET_LINK_LIBRARIES(oppo-a37-test PRIVATE cpuinfo_mock gtest) |
| 452 | ADD_TEST(oppo-a37-test oppo-a37-test) |
| 453 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 454 | ADD_EXECUTABLE(oppo-r9-test test/mock/oppo-r9.cc) |
| 455 | TARGET_INCLUDE_DIRECTORIES(oppo-r9-test PRIVATE test/mock) |
| 456 | TARGET_LINK_LIBRARIES(oppo-r9-test PRIVATE cpuinfo_mock gtest) |
| 457 | ADD_TEST(oppo-r9-test oppo-r9-test) |
| 458 | |
| 459 | ADD_EXECUTABLE(pixel-test test/mock/pixel.cc) |
| 460 | TARGET_INCLUDE_DIRECTORIES(pixel-test PRIVATE test/mock) |
| 461 | TARGET_LINK_LIBRARIES(pixel-test PRIVATE cpuinfo_mock gtest) |
| 462 | ADD_TEST(pixel-test pixel-test) |
| 463 | |
| 464 | ADD_EXECUTABLE(pixel-c-test test/mock/pixel-c.cc) |
| 465 | TARGET_INCLUDE_DIRECTORIES(pixel-c-test PRIVATE test/mock) |
| 466 | TARGET_LINK_LIBRARIES(pixel-c-test PRIVATE cpuinfo_mock gtest) |
| 467 | ADD_TEST(pixel-c-test pixel-c-test) |
| 468 | |
| 469 | ADD_EXECUTABLE(pixel-xl-test test/mock/pixel-xl.cc) |
| 470 | TARGET_INCLUDE_DIRECTORIES(pixel-xl-test PRIVATE test/mock) |
| 471 | TARGET_LINK_LIBRARIES(pixel-xl-test PRIVATE cpuinfo_mock gtest) |
| 472 | ADD_TEST(pixel-xl-test pixel-xl-test) |
| 473 | |
Marat Dukhan | 9bfb107 | 2017-11-27 17:02:25 -0800 | [diff] [blame] | 474 | ADD_EXECUTABLE(pixel-2-xl-test test/mock/pixel-2-xl.cc) |
| 475 | TARGET_INCLUDE_DIRECTORIES(pixel-2-xl-test PRIVATE test/mock) |
| 476 | TARGET_LINK_LIBRARIES(pixel-2-xl-test PRIVATE cpuinfo_mock gtest) |
| 477 | ADD_TEST(pixel-2-xl-test pixel-2-xl-test) |
| 478 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 479 | ADD_EXECUTABLE(xiaomi-mi-5c-test test/mock/xiaomi-mi-5c.cc) |
| 480 | TARGET_INCLUDE_DIRECTORIES(xiaomi-mi-5c-test PRIVATE test/mock) |
| 481 | TARGET_LINK_LIBRARIES(xiaomi-mi-5c-test PRIVATE cpuinfo_mock gtest) |
| 482 | ADD_TEST(xiaomi-mi-5c-test xiaomi-mi-5c-test) |
| 483 | |
| 484 | ADD_EXECUTABLE(xiaomi-redmi-note-3-test test/mock/xiaomi-redmi-note-3.cc) |
| 485 | TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-note-3-test PRIVATE test/mock) |
| 486 | TARGET_LINK_LIBRARIES(xiaomi-redmi-note-3-test PRIVATE cpuinfo_mock gtest) |
| 487 | ADD_TEST(xiaomi-redmi-note-3-test xiaomi-redmi-note-3-test) |
| 488 | |
Marat Dukhan | a5fda23 | 2017-12-04 16:08:25 -0800 | [diff] [blame] | 489 | ADD_EXECUTABLE(xiaomi-redmi-note-4-test test/mock/xiaomi-redmi-note-4.cc) |
| 490 | TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-note-4-test PRIVATE test/mock) |
| 491 | TARGET_LINK_LIBRARIES(xiaomi-redmi-note-4-test PRIVATE cpuinfo_mock gtest) |
| 492 | ADD_TEST(xiaomi-redmi-note-4-test xiaomi-redmi-note-4-test) |
| 493 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 494 | ADD_EXECUTABLE(xperia-c4-dual-test test/mock/xperia-c4-dual.cc) |
| 495 | TARGET_INCLUDE_DIRECTORIES(xperia-c4-dual-test PRIVATE test/mock) |
| 496 | TARGET_LINK_LIBRARIES(xperia-c4-dual-test PRIVATE cpuinfo_mock gtest) |
| 497 | ADD_TEST(xperia-c4-dual-test xperia-c4-dual-test) |
| 498 | ENDIF() |
| 499 | |
| 500 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$") |
Marat Dukhan | af8a12d | 2017-12-08 16:12:16 -0800 | [diff] [blame] | 501 | ADD_EXECUTABLE(alldocube-iwork8-test test/mock/alldocube-iwork8.cc) |
| 502 | TARGET_INCLUDE_DIRECTORIES(alldocube-iwork8-test PRIVATE test/mock) |
| 503 | TARGET_LINK_LIBRARIES(alldocube-iwork8-test PRIVATE cpuinfo_mock gtest) |
| 504 | ADD_TEST(alldocube-iwork8-test alldocube-iwork8-test) |
| 505 | |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 506 | ADD_EXECUTABLE(memo-pad-7-test test/mock/memo-pad-7.cc) |
| 507 | TARGET_INCLUDE_DIRECTORIES(memo-pad-7-test PRIVATE test/mock) |
| 508 | TARGET_LINK_LIBRARIES(memo-pad-7-test PRIVATE cpuinfo_mock gtest) |
| 509 | ADD_TEST(memo-pad-7-test memo-pad-7-test) |
| 510 | |
| 511 | ADD_EXECUTABLE(zenfone-c-test test/mock/zenfone-c.cc) |
| 512 | TARGET_INCLUDE_DIRECTORIES(zenfone-c-test PRIVATE test/mock) |
| 513 | TARGET_LINK_LIBRARIES(zenfone-c-test PRIVATE cpuinfo_mock gtest) |
| 514 | ADD_TEST(zenfone-c-test zenfone-c-test) |
| 515 | |
| 516 | ADD_EXECUTABLE(zenfone-2-test test/mock/zenfone-2.cc) |
| 517 | TARGET_INCLUDE_DIRECTORIES(zenfone-2-test PRIVATE test/mock) |
| 518 | TARGET_LINK_LIBRARIES(zenfone-2-test PRIVATE cpuinfo_mock gtest) |
| 519 | ADD_TEST(zenfone-2-test zenfone-2-test) |
| 520 | |
| 521 | ADD_EXECUTABLE(zenfone-2e-test test/mock/zenfone-2e.cc) |
| 522 | TARGET_INCLUDE_DIRECTORIES(zenfone-2e-test PRIVATE test/mock) |
| 523 | TARGET_LINK_LIBRARIES(zenfone-2e-test PRIVATE cpuinfo_mock gtest) |
| 524 | ADD_TEST(zenfone-2e-test zenfone-2e-test) |
| 525 | ENDIF() |
| 526 | ENDIF() |
| 527 | |
| 528 | # ---[ cpuinfo unit tests |
| 529 | IF(CPUINFO_BUILD_UNIT_TESTS) |
| 530 | ADD_EXECUTABLE(init-test test/init.cc) |
| 531 | TARGET_LINK_LIBRARIES(init-test PRIVATE cpuinfo gtest) |
| 532 | ADD_TEST(init-test init-test) |
| 533 | |
| 534 | IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") |
| 535 | ADD_EXECUTABLE(get-current-test test/get-current.cc) |
| 536 | TARGET_LINK_LIBRARIES(get-current-test PRIVATE cpuinfo gtest) |
| 537 | ADD_TEST(get-current-test get-current-test) |
| 538 | ENDIF() |
| 539 | |
| 540 | IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$") |
| 541 | ADD_EXECUTABLE(brand-string-test test/name/brand-string.cc) |
| 542 | TARGET_LINK_LIBRARIES(brand-string-test PRIVATE cpuinfo gtest gtest_main) |
| 543 | ADD_TEST(brand-string-test brand-string-test) |
| 544 | ENDIF() |
| 545 | |
| 546 | IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a|aarch64)$") |
| 547 | ADD_LIBRARY(android_properties_interface test/name/android-properties-interface.c) |
| 548 | TARGET_INCLUDE_DIRECTORIES(android_properties_interface PRIVATE src) |
| 549 | TARGET_LINK_LIBRARIES(android_properties_interface PRIVATE cpuinfo) |
| 550 | |
| 551 | ADD_EXECUTABLE(chipset-test |
| 552 | test/name/proc-cpuinfo-hardware.cc |
| 553 | test/name/ro-product-board.cc |
| 554 | test/name/ro-board-platform.cc |
| 555 | test/name/ro-mediatek-platform.cc |
| 556 | test/name/ro-chipname.cc |
| 557 | test/name/android-properties.cc) |
| 558 | TARGET_LINK_LIBRARIES(chipset-test PRIVATE android_properties_interface gtest gtest_main) |
| 559 | ADD_TEST(chipset-test chipset-test) |
| 560 | |
| 561 | ADD_EXECUTABLE(cache-test test/arm-cache.cc) |
| 562 | TARGET_COMPILE_DEFINITIONS(cache-test PRIVATE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS) |
| 563 | TARGET_INCLUDE_DIRECTORIES(cache-test PRIVATE src) |
| 564 | TARGET_LINK_LIBRARIES(cache-test PRIVATE cpuinfo gtest gtest_main) |
| 565 | ADD_TEST(cache-test, cache-test) |
| 566 | ENDIF() |
Marat Dukhan | b8a8337 | 2017-10-13 21:07:44 -0400 | [diff] [blame] | 567 | ENDIF() |
| 568 | |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 569 | # ---[ Helper and debug tools |
Marat Dukhan | f1c4a5c | 2017-10-25 17:22:11 -0700 | [diff] [blame] | 570 | IF(CPUINFO_BUILD_TOOLS) |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 571 | ADD_EXECUTABLE(isa-info tools/isa-info.c) |
| 572 | TARGET_LINK_LIBRARIES(isa-info PRIVATE cpuinfo) |
| 573 | |
| 574 | ADD_EXECUTABLE(cpu-info tools/cpu-info.c) |
| 575 | TARGET_LINK_LIBRARIES(cpu-info PRIVATE cpuinfo) |
| 576 | |
| 577 | ADD_EXECUTABLE(cache-info tools/cache-info.c) |
| 578 | TARGET_LINK_LIBRARIES(cache-info PRIVATE cpuinfo) |
| 579 | |
Marat Dukhan | f3a71e6 | 2017-11-29 15:15:36 -0800 | [diff] [blame] | 580 | IF(CMAKE_SYSTEM_NAME MATCHES "^(Android|Linux)$" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7|armv7-a|armv7l|arm64|aarch64)$") |
| 581 | ADD_EXECUTABLE(auxv-dump tools/auxv-dump.c) |
| 582 | TARGET_INCLUDE_DIRECTORIES(auxv-dump PRIVATE src) |
| 583 | TARGET_INCLUDE_DIRECTORIES(auxv-dump PRIVATE include) |
| 584 | ENDIF() |
| 585 | |
Marat Dukhan | 3645b92 | 2017-10-13 17:03:35 -0400 | [diff] [blame] | 586 | IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$") |
| 587 | ADD_EXECUTABLE(cpuid-dump tools/cpuid-dump.c) |
| 588 | TARGET_INCLUDE_DIRECTORIES(cpuid-dump PRIVATE src) |
| 589 | TARGET_INCLUDE_DIRECTORIES(cpuid-dump PRIVATE include) |
| 590 | ENDIF() |
| 591 | ENDIF() |