# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. # SPDX-License-Identifier: Apache-2.0 cmake_minimum_required(VERSION 3.13.1) set(ENV{QEMU_BIN_PATH} "${CMAKE_SOURCE_DIR}/qemu-hack") set(QEMU_PIPE "\${QEMU_PIPE}") # QEMU_PIPE is set by the calling TVM instance. find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) project(microtvm_autogenerated_project) set(CRT_LIBS ) set(CRT_LIB_BASE crt/src/runtime/crt) foreach(crt_lib_name ${CRT_LIBS}) zephyr_library_named(${crt_lib_name}) file(GLOB_RECURSE crt_lib_srcs ${CRT_LIB_BASE}/${crt_lib_name}/*.c ${CRT_LIB_BASE}/${crt_lib_name}/*.cc) target_sources(${crt_lib_name} PRIVATE ${crt_lib_srcs}) zephyr_library_include_directories(${crt_lib_name} PRIVATE crt_config crt/include) target_link_libraries(app PRIVATE ${crt_lib_name}) endforeach(crt_lib_name ${CRT_LIBS}) # define a library for the model sources. zephyr_library_named(tvm_model) file(GLOB_RECURSE tvm_model_srcs model/codegen/host/src/*.c model/codegen/host/lib/*.o) target_sources(tvm_model PRIVATE ${tvm_model_srcs}) target_include_directories(tvm_model PRIVATE ${CMAKE_SOURCE_DIR}/include crt_config crt/include) target_compile_options(tvm_model PRIVATE -Wno-unused-variable) # TVM-generated code tends to include lots of these. target_link_libraries(app PRIVATE tvm_model) file(GLOB_RECURSE app_srcs src/**.c) target_sources(app PRIVATE ${app_srcs}) target_include_directories(app PRIVATE crt_config ${CMAKE_SOURCE_DIR}/include crt/include)