-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[buildmgr] Enable CMake to handle AC6 projects with only legacy assem…
…bly files
- Loading branch information
1 parent
3932e32
commit 300d6b2
Showing
8 changed files
with
159 additions
and
1 deletion.
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
4 changes: 3 additions & 1 deletion
4
tools/buildmgr/cbuildgen/config/CMakeASM/CMakeDetermineAS_ARMCompiler.cmake
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
set(CMAKE_AS_ARM_COMPILER_ENV_VAR "AS_ARM") | ||
configure_file(${CMAKE_MODULE_PATH}/CMakeAS_ARMCompiler.cmake.in ${CMAKE_PLATFORM_INFO_DIR}/CMakeAS_ARMCompiler.cmake) | ||
configure_file(${CMAKE_MODULE_PATH}/CMakeAS_ARMCompiler.cmake.in ${CMAKE_PLATFORM_INFO_DIR}/CMakeAS_ARMCompiler.cmake) | ||
include(${CMAKE_ROOT}/Modules/Compiler/ARMClang.cmake) | ||
__compiler_armclang(AS_ARM) |
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
8 changes: 8 additions & 0 deletions
8
tools/buildmgr/test/testinput/Examples/AC6/ArmAsm/ArmSyntax.s
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,8 @@ | ||
|
||
AREA DATA | ||
|
||
IF :LNOT::DEF:_RTE_ | ||
INFO 1, "_RTE_ is not defined!" | ||
ENDIF | ||
|
||
END |
70 changes: 70 additions & 0 deletions
70
tools/buildmgr/test/testinput/Examples/AC6/ArmAsm/CMakeLists.txt.ref
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,70 @@ | ||
# CMSIS Build CMakeLists generated on 2023-08-29T15:26:15 | ||
|
||
cmake_minimum_required(VERSION 3.22) | ||
|
||
# Target options | ||
|
||
set(TARGET Blinky) | ||
set(CPU Cortex-M3) | ||
set(PRJ_DIR "C:/sandbox/devtools/build/TestOutput/TestData/Examples/AC6/ArmAsm") | ||
set(OUT_DIR "C:/sandbox/devtools/build/TestOutput/TestData/Examples/AC6/ArmAsm/OutDir") | ||
set(INT_DIR "C:/sandbox/devtools/build/TestOutput/TestData/Examples/AC6/ArmAsm/IntDir") | ||
set(FPU NO_FPU) | ||
set(DSP NO_DSP) | ||
set(TZ NO_TZ) | ||
set(SECURE Non-secure) | ||
set(MVE NO_MVE) | ||
set(BYTE_ORDER Little-endian) | ||
set(AS_FLAGS_GLOBAL "-masm=auto") | ||
set(LD_SCRIPT "C:/sandbox/devtools/build/TestOutput/TestData/Examples/AC6/ArmAsm/LinkerScript.sct") | ||
|
||
set(DEFINES | ||
ARMCM3 | ||
_RTE_ | ||
) | ||
|
||
set(INC_PATHS | ||
"C:/sandbox/devtools/build/TestOutput/TestData/Examples/AC6/ArmAsm/RTE/_Target_1" | ||
"C:/Users/Test/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/Core/Include" | ||
"C:/Users/Test/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/Device/ARM/ARMCM3/Include" | ||
) | ||
|
||
set(AS_ARM_SRC_FILES | ||
"C:/sandbox/devtools/build/TestOutput/TestData/Examples/AC6/ArmAsm/ArmSyntax.s" | ||
) | ||
|
||
# Toolchain config map | ||
|
||
set(TOOLCHAIN_VERSION_MIN "6.0.0") | ||
set(TOOLCHAIN_VERSION_MAX "6.99.99") | ||
include ("C:/sandbox/cbuild/etc/AC6.6.18.0.cmake") | ||
include ("C:/sandbox/cbuild/etc/CMSIS-Build-Utils.cmake") | ||
|
||
# Setup project | ||
|
||
project(${TARGET} LANGUAGES AS_ARM) | ||
|
||
cbuild_get_running_toolchain(TOOLCHAIN_ROOT TOOLCHAIN_VERSION AS_ARM) | ||
|
||
# Global Flags | ||
|
||
set(CMAKE_AS_ARM_FLAGS "${AS_ARM_CPU} ${AS_ARM_BYTE_ORDER} ${AS_ARM_DEFINES} ${AS_ARM_FLAGS} ${AS_FLAGS_GLOBAL}") | ||
set(CMAKE_C_LINK_FLAGS "${LD_CPU} ${_LS}\"${LD_SCRIPT}\" ${LD_SECURE} ${LD_FLAGS}") | ||
|
||
# Local Flags | ||
|
||
foreach(SRC ${AS_ARM_SRC_FILES}) | ||
set_source_files_properties(${SRC} PROPERTIES LANGUAGE AS_ARM) | ||
endforeach() | ||
|
||
# Compilation Database | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
add_custom_target(database COMMAND ${CMAKE_COMMAND} -E copy_if_different "${INT_DIR}/compile_commands.json" "${OUT_DIR}") | ||
|
||
# Setup Target | ||
|
||
add_executable(${TARGET} ${AS_ARM_SRC_FILES}) | ||
set_target_properties(${TARGET} PROPERTIES PREFIX "" SUFFIX ".axf" OUTPUT_NAME "Blinky") | ||
set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUT_DIR} LINK_DEPENDS ${LD_SCRIPT}) | ||
target_include_directories(${TARGET} PUBLIC ${INC_PATHS}) |
9 changes: 9 additions & 0 deletions
9
tools/buildmgr/test/testinput/Examples/AC6/ArmAsm/LinkerScript.sct
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,9 @@ | ||
|
||
LR_IROM1 0x08000000 0x00080000 { ; load region size_region | ||
ER_IROM1 0x08000000 0x00080000 { ; load address = execution address | ||
.ANY (+RO) | ||
} | ||
RW_IRAM1 0x20000000 0x00001000 { ; RW data | ||
.ANY (+RW +ZI) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
tools/buildmgr/test/testinput/Examples/AC6/ArmAsm/RTE/_Target_1/RTE_Components.h
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,20 @@ | ||
/* | ||
* CBUILDGEN generated file: DO NOT EDIT! | ||
* Generated by: cbuildgen version 2.1.0-dev1 | ||
* | ||
* Project: 'Target' | ||
* Target: 'Target 1' | ||
*/ | ||
|
||
#ifndef RTE_COMPONENTS_H | ||
#define RTE_COMPONENTS_H | ||
|
||
|
||
/* | ||
* Define the Device Header File: | ||
*/ | ||
#define CMSIS_device_header "ARMCM3.h" | ||
|
||
|
||
|
||
#endif /* RTE_COMPONENTS_H */ |
32 changes: 32 additions & 0 deletions
32
tools/buildmgr/test/testinput/Examples/AC6/ArmAsm/Target.cprj
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,32 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<cprj schemaVersion="2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd"> | ||
|
||
<created timestamp="2020-09-04T10:07:24" tool="uVision V5.31.0.0"/> | ||
|
||
<packages> | ||
<package name="CMSIS" vendor="ARM"/> | ||
<package name="ARM_Compiler" vendor="Keil"/> | ||
</packages> | ||
|
||
<compilers> | ||
<compiler name="AC6" version="6.0.0:6.99.99"/> | ||
</compilers> | ||
|
||
<target Ddsp="NO_DSP" Dendian="Little-endian" Dfpu="NO_FPU" Dmve="NO_MVE" Dname="ARMCM3" Dsecure="Non-secure" Dtz="NO_TZ" Dvendor="ARM:82"> | ||
<output elf="Blinky.axf" name="Blinky" type="exe"/> | ||
<ldflags compiler="AC6" file="./LinkerScript.sct"/> | ||
<asflags add="-masm=auto" compiler="AC6"/> | ||
</target> | ||
|
||
<components> | ||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM"/> | ||
</components> | ||
|
||
<files> | ||
<group name="Source Files"> | ||
<file category="sourceAsm" name="./ArmSyntax.s"> | ||
</file> | ||
</group> | ||
</files> | ||
|
||
</cprj> |