aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmake/cpu.cmake
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-01-15 00:36:03 +0100
committerDave Barach <openvpp@barachs.net>2019-01-17 20:43:27 +0000
commitdd3952923a2cfb9fa2276a4f1f6512ff75e1a155 (patch)
tree6065513bac01b665c1925d31cf8b7d982ac9acd5 /src/cmake/cpu.cmake
parent58a93e8ef288b0bae75ec7186ba96bdcaf85d0d4 (diff)
cmake: initial cross-compilation support
Change-Id: Ib9c2aba1eda08a22465441e33553b9b744c79d56 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/cmake/cpu.cmake')
-rw-r--r--src/cmake/cpu.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmake/cpu.cmake b/src/cmake/cpu.cmake
index 20dab7bfce1..b2af1aa0926 100644
--- a/src/cmake/cpu.cmake
+++ b/src/cmake/cpu.cmake
@@ -14,7 +14,10 @@
##############################################################################
# Cache line size detection
##############################################################################
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
+if(CMAKE_CROSSCOMPILING)
+ message(STATUS "Cross-compiling - cache line size detection disabled")
+ set(VPP_LOG2_CACHE_LINE_SIZE 6)
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
file(READ "/proc/cpuinfo" cpuinfo)
string(REPLACE "\n" ";" cpuinfo ${cpuinfo})
foreach(l ${cpuinfo})