-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI config update, toolchain config update (#26)
Signed-off-by: Adam BZH <[email protected]>
- Loading branch information
1 parent
a3889ef
commit bf4574f
Showing
6 changed files
with
70 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
############################### | ||
# Toolchain | ||
message("TOOL_CHAIN_PREFIX=${TOOL_CHAIN_PREFIX}") | ||
# input required | ||
if (NOT TOOL_CHAIN_PREFIX) | ||
message(FATAL_ERROR "TOOL_CHAIN_PREFIX required but not set") | ||
endif () | ||
# standard | ||
set(CMAKE_C_STANDARD 17) | ||
set(CMAKE_C_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
# cross options | ||
set(CMAKE_SYSTEM_NAME Generic) | ||
set(CMAKE_SYSTEM_PROCESSOR ARM) | ||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") | ||
# search programs | ||
find_program(CMAKE_ASM_COMPILER NAMES ${TOOL_CHAIN_PREFIX}-gcc) | ||
find_program(CMAKE_C_COMPILER NAMES ${TOOL_CHAIN_PREFIX}-gcc) | ||
find_program(CMAKE_CXX_COMPILER NAMES ${TOOL_CHAIN_PREFIX}-g++) | ||
find_program(CMAKE_OBJCOPY NAMES ${TOOL_CHAIN_PREFIX}-objcopy) | ||
# set(CMAKE_ASM_COMPILER ${TOOL_CHAIN_PREFIX}-gcc) | ||
# set(CMAKE_C_COMPILER ${TOOL_CHAIN_PREFIX}-gcc) | ||
# set(CMAKE_CXX_COMPILER ${TOOL_CHAIN_PREFIX}-g++) | ||
# set(CMAKE_OBJCOPY ${TOOL_CHAIN_PREFIX}-objcopy) | ||
message("CMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER}") | ||
message("CMAKE_C_COMPILER=${CMAKE_C_COMPILER}") | ||
message("CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}") | ||
message("CMAKE_OBJCOPY=${CMAKE_OBJCOPY}") | ||
# check tools | ||
if ((NOT CMAKE_ASM_COMPILER) OR (NOT CMAKE_C_COMPILER) OR (NOT CMAKE_CXX_COMPILER) OR (NOT CMAKE_OBJCOPY)) | ||
message(FATAL_ERROR "Valid toolchain not found") | ||
endif () | ||
# get sysroot | ||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-sysroot | ||
OUTPUT_VARIABLE ARM_GCC_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
set(CMAKE_SYSROOT ${ARM_GCC_SYSROOT}) | ||
# set root path | ||
set(CMAKE_FIND_ROOT_PATH ${CMAKE_C_COMPILER}) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |