Clarify regex in clang toolchain file
This commit is contained in:
parent
8d15b46cf4
commit
59cc9ac810
@ -17,7 +17,8 @@ if(NOT TARGET_TRIPLET)
|
||||
set(TARGET_TRIPLET ${HOST_TRIPLET})
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "^[^-]*" TARGET_PROCESSOR ${TARGET_TRIPLET})
|
||||
# Get target processor from target triplet (first in triplet, ex. for arm-none-eabi -> arm)
|
||||
string(REGEX MATCH "^[^-]*" TARGET_ARCHITECTURE ${TARGET_TRIPLET})
|
||||
|
||||
if(NOT CMAKE_SYSTEM_NAME)
|
||||
# Cmake uses Generic as system name for embedded systems, use that here if
|
||||
@ -31,8 +32,8 @@ if(NOT CMAKE_SYSTEM_VERSION)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_SYSTEM_PROCESSOR)
|
||||
# Getting processor from target triplet, should not be setting CMAKE_SYSTEM_PROCESSOR
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${TARGET_PROCESSOR})
|
||||
# Getting architecture from target triplet, should not be setting CMAKE_SYSTEM_PROCESSOR
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCHITECTURE})
|
||||
endif()
|
||||
|
||||
message(STATUS "Target: ${TARGET_TRIPLET}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user