| # Copyright 2023 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| add_library(samples_branch_mul_branch_mul_lib |
| STATIC |
| branch_mul_c.o |
| ) |
| |
| set_target_properties( |
| samples_branch_mul_branch_mul_lib |
| PROPERTIES |
| LINKER_LANGUAGE C) |
| |
| sparrow_test( |
| NAME |
| branch_mul_emitc_static |
| SRCS |
| "branch_mul.c" |
| DEPS |
| samples_branch_mul_branch_mul_lib |
| iree::base |
| iree::vm::bytecode::module |
| iree::hal::local::executable_environment |
| iree::hal::local::elf::elf_module |
| LINKOPTS |
| "LINKER:--defsym=__stack_size__=300k" |
| "LINKER:--defsym=__heap_size__=750k" |
| "LINKER:--defsym=__tcm_length__=4M" |
| TESTFILES |
| "branch_mul.run" |
| "branch_mul_bin.run" |
| ) |
| |
| # Kelvin-only systemc tests |
| if (${BUILD_WITH_KELVIN}) |
| |
| add_custom_command( |
| TARGET |
| samples_branch_mul_branch_mul_emitc_static |
| POST_BUILD |
| COMMAND |
| ${CMAKE_OBJCOPY} -g -O binary |
| branch_mul_emitc_static |
| branch_mul_emitc_static.bin |
| BYPRODUCTS |
| branch_mul_emitc_static.bin |
| COMMENT |
| "Objcopy the binary file" |
| ) |
| |
| endif() |