mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-12 23:43:59 +03:00
Tests/RunCMake/IAR: Extend tests to actually build
Extend the tests from commit 37e44707bc (IAR: Add tests covering IAR
toolchains, 2023-10-21) to actually drive the generated build system.
This commit is contained in:
1 parent
9f52953df5
commit
a772c2c384
1 file changed
+15
-12
@@ -8,6 +8,13 @@ if(RunCMake_GENERATOR MATCHES "Makefile|Ninja")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
function(run_toolchain case)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
|
||||
run_cmake_with_options(${case} ${ARGN})
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .)
|
||||
endfunction()
|
||||
|
||||
foreach(_iar_toolchain IN LISTS _iar_toolchains)
|
||||
message(STATUS "Found IAR toolchain: ${_iar_toolchain}")
|
||||
cmake_path(GET _iar_toolchain PARENT_PATH BIN_DIR)
|
||||
@@ -17,8 +24,8 @@ foreach(_iar_toolchain IN LISTS _iar_toolchains)
|
||||
# Sets the minimal requirements for linking each target architecture
|
||||
if(ARCH STREQUAL "avr")
|
||||
string(CONCAT LINK_OPTS
|
||||
"-I${TOOLKIT_DIR}/../lib "
|
||||
"-f ${TOOLKIT_DIR}/../src/template/lnk3s.xcl "
|
||||
"-I${TOOLKIT_DIR}/lib "
|
||||
"-f ${TOOLKIT_DIR}/src/template/lnk3s.xcl "
|
||||
)
|
||||
elseif(ARCH STREQUAL "rl78")
|
||||
string(CONCAT LINK_OPTS
|
||||
@@ -41,30 +48,26 @@ foreach(_iar_toolchain IN LISTS _iar_toolchains)
|
||||
PATHS ${BIN_DIR}
|
||||
REQUIRED )
|
||||
|
||||
set(RunCMake_TEST_OPTIONS
|
||||
run_toolchain(iar-c
|
||||
-DCMAKE_SYSTEM_NAME=Generic
|
||||
-DCMAKE_C_COMPILER=${_iar_toolchain}
|
||||
-DCMAKE_EXE_LINKER_FLAGS=${LINK_OPTS}
|
||||
)
|
||||
run_cmake(iar-c)
|
||||
|
||||
set(RunCMake_TEST_OPTIONS
|
||||
run_toolchain(iar-cxx
|
||||
-DCMAKE_SYSTEM_NAME=Generic
|
||||
-DCMAKE_CXX_COMPILER=${_iar_toolchain}
|
||||
-DCMAKE_EXE_LINKER_FLAGS=${LINK_OPTS}
|
||||
)
|
||||
run_cmake(iar-cxx)
|
||||
|
||||
set(RunCMake_TEST_OPTIONS
|
||||
run_toolchain(iar-asm
|
||||
-DCMAKE_SYSTEM_NAME=Generic
|
||||
-DCMAKE_ASM_COMPILER=${IAR_ASSEMBLER}
|
||||
)
|
||||
run_cmake(iar-asm)
|
||||
)
|
||||
|
||||
set(RunCMake_TEST_OPTIONS
|
||||
run_toolchain(iar-lib
|
||||
-DCMAKE_SYSTEM_NAME=Generic
|
||||
-DCMAKE_C_COMPILER=${_iar_toolchain}
|
||||
-DCMAKE_EXE_LINKER_FLAGS=${LINK_OPTS}
|
||||
)
|
||||
run_cmake(iar-lib)
|
||||
)
|
||||
endforeach()
|
||||
Reference in new issue
Block a user