diff --git a/cmake/clang.cmake b/cmake/clang.cmake index 9c670f6..6cc6a08 100644 --- a/cmake/clang.cmake +++ b/cmake/clang.cmake @@ -20,6 +20,11 @@ endif() # Get target processor from target triplet (first in triplet, ex. for arm-none-eabi -> arm) string(REGEX MATCH "^[^-]*" TARGET_ARCHITECTURE ${TARGET_TRIPLET}) +# We need to tell clang what our target is +set(CMAKE_ASM_COMPILER_TARGET ${TARGET_TRIPLET}) +set(CMAKE_C_COMPILER_TARGET ${TARGET_TRIPLET}) +set(CMAKE_CXX_COMPILER_TARGET ${TARGET_TRIPLET}) + if(NOT CMAKE_SYSTEM_NAME) # Cmake uses Generic as system name for embedded systems, use that here if # working on embedded systems