From 5024f89c1bc657f720367bdf9a14b9859dc2fe18 Mon Sep 17 00:00:00 2001 From: Adrian Herrera Date: Wed, 7 Aug 2024 21:49:48 +0000 Subject: [PATCH] cmake: use clang++ when cross-compiling to ARM64 --- CMakeLists.txt | 1 + cmake/arm64_cross_compile.cmake | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6acbd6..f49b0a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES arm64) ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CFLAGS="--target=aarch64-linux-gnu --prefix=aarch64-linux-gnu-" ) set(CMAKE_C_FLAGS "--target=aarch64-linux-gnu --prefix=aarch64-linux-gnu-") + set(CMAKE_CXX_FLAGS "--target=aarch64-linux-gnu --prefix=aarch64-linux-gnu-") endif() if(KFLAT_OPTS) diff --git a/cmake/arm64_cross_compile.cmake b/cmake/arm64_cross_compile.cmake index af6f5bd..6e4a85e 100644 --- a/cmake/arm64_cross_compile.cmake +++ b/cmake/arm64_cross_compile.cmake @@ -9,9 +9,9 @@ if (NOT CLANG_DIR) endif() set(CMAKE_C_COMPILER ${CLANG_DIR}/bin/clang.real) set(CMAKE_LINKER ${CLANG_DIR}/bin/ld.lld) -set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) +set(CMAKE_CXX_COMPILER ${CLANG_DIR}/bin/clang++.real) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) \ No newline at end of file +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)