Skip to content

Commit 9d8807c

Browse files
author
Felipe Torrezan
authored
Enhanced support for CSpyBat (#22)
Added improved detection scheme for CSpyBat in the CTest functionality for arm.
1 parent 4451d32 commit 9d8807c

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
_build*
2+
build*
23
hello-world
34
Testing
45

examples/arm/iar-cspy-arm.cmake

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,32 @@
22
# to execute the `IAR C-SPY Command-line Utility (cspybat.exe)`
33

44
function(iar_cspy_add_test TARGET TEST_NAME EXPECTED_OUTPUT)
5+
find_program(CSPY_BAT
6+
NAMES cspybat CSpyBat
7+
PATHS ${TOOLKIT_DIR}/../common
8+
PATH_SUFFIXES bin
9+
REQUIRED )
10+
11+
# Check if C-SPY is being run from BX
12+
if(WIN32)
13+
set(libPREFIX "")
14+
set(libPROCsuffix proc.dll)
15+
set(libSIM2suffix sim2.dll)
16+
set(libBATsuffix bat.dll)
17+
else()
18+
set(libPREFIX lib)
19+
set(libPROCsuffix PROC.so)
20+
set(libSIM2suffix SIM2.so)
21+
set(libBATsuffix Bat.so)
22+
endif()
23+
524
# Add a test for CTest
625
add_test(NAME ${TEST_NAME}
7-
COMMAND ${TOOLKIT_DIR}/../common/bin/cspybat --silent
26+
COMMAND ${CSPY_BAT} --silent
827
# C-SPY drivers
9-
"${TOOLKIT_DIR}/bin/${CMAKE_SYSTEM_PROCESSOR}proc.dll"
10-
"${TOOLKIT_DIR}/bin/${CMAKE_SYSTEM_PROCESSOR}sim2.dll"
11-
"--plugin=${TOOLKIT_DIR}/bin/${CMAKE_SYSTEM_PROCESSOR}bat.dll"
28+
"${TOOLKIT_DIR}/bin/${libPREFIX}${CMAKE_SYSTEM_PROCESSOR}${libPROCsuffix}"
29+
"${TOOLKIT_DIR}/bin/${libPREFIX}${CMAKE_SYSTEM_PROCESSOR}${libSIM2suffix}"
30+
"--plugin=${TOOLKIT_DIR}/bin/${libPREFIX}${CMAKE_SYSTEM_PROCESSOR}${libBATsuffix}"
1231
--debug_file=$<TARGET_FILE:${TARGET}>
1332
$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},DMAC>>,--device_macro=$<TARGET_PROPERTY:${TARGET},DMAC>,>
1433
# C-SPY macros settings

0 commit comments

Comments
 (0)