Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/ruy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt21
-rw-r--r--cmake/ruy_include_directories.cmake2
-rw-r--r--ruy/BUILD2
-rw-r--r--ruy/cpuinfo.cc2
4 files changed, 16 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6577dd8..e0f24b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,13 +30,18 @@ include(cmake/ruy_cc_library.cmake)
include(cmake/ruy_cc_binary.cmake)
include(cmake/ruy_cc_test.cmake)
-# Disabling cpuinfo's tests and benchmarks to prevent a copy of its
-# googletest dependency getting downloaded into a 'deps' directory in the
-# source tree!
-set(CPUINFO_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
-set(CPUINFO_BUILD_UNIT_TESTS OFF CACHE BOOL "" FORCE)
-set(CPUINFO_BUILD_MOCK_TESTS OFF CACHE BOOL "" FORCE)
-add_subdirectory("third_party/cpuinfo" EXCLUDE_FROM_ALL)
-add_subdirectory("third_party/googletest" EXCLUDE_FROM_ALL)
+if (NOT TARGET cpuinfo)
+ # Disabling cpuinfo's tests and benchmarks to prevent a copy of its
+ # googletest dependency getting downloaded into a 'deps' directory in the
+ # source tree!
+ set(CPUINFO_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
+ set(CPUINFO_BUILD_UNIT_TESTS OFF CACHE BOOL "" FORCE)
+ set(CPUINFO_BUILD_MOCK_TESTS OFF CACHE BOOL "" FORCE)
+ add_subdirectory("third_party/cpuinfo" EXCLUDE_FROM_ALL)
+endif()
+
+if (NOT TARGET gtest)
+ add_subdirectory("third_party/googletest" EXCLUDE_FROM_ALL)
+endif()
ruy_add_all_subdirs()
diff --git a/cmake/ruy_include_directories.cmake b/cmake/ruy_include_directories.cmake
index d2e0ad1..e9b50a9 100644
--- a/cmake/ruy_include_directories.cmake
+++ b/cmake/ruy_include_directories.cmake
@@ -20,7 +20,7 @@ function(ruy_include_directories NAME DEPS)
if (cpuinfo IN_LIST DEPS)
target_include_directories(${NAME}
PRIVATE
- "${PROJECT_SOURCE_DIR}/third_party/cpuinfo"
+ "${PROJECT_SOURCE_DIR}/third_party/cpuinfo/include"
)
endif()
if ((gtest IN_LIST DEPS) OR
diff --git a/ruy/BUILD b/ruy/BUILD
index 4cbeee1..37e89ab 100644
--- a/ruy/BUILD
+++ b/ruy/BUILD
@@ -404,7 +404,7 @@ cc_library(
":ppc": [],
":s390x": [],
":fuchsia": [],
- "//conditions:default": ["@cpuinfo//:cpuinfo_with_unstripped_include_path"],
+ "//conditions:default": ["@cpuinfo"],
}),
)
diff --git a/ruy/cpuinfo.cc b/ruy/cpuinfo.cc
index a4e71ef..b1f54bc 100644
--- a/ruy/cpuinfo.cc
+++ b/ruy/cpuinfo.cc
@@ -9,7 +9,7 @@
#include "ruy/platform.h"
#ifdef RUY_HAVE_CPUINFO
-#include "include/cpuinfo.h"
+#include <cpuinfo.h>
#endif
namespace ruy {