-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[microTVM][CRT]Move Makefile to CMake to be cross-platform compatible (…
…#14013) This PR converts CRT Makefile to a CMakelist file to be cross platform compatible.
- Loading branch information
Showing
5 changed files
with
88 additions
and
120 deletions.
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
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,59 @@ | ||
# 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.18) | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
project(crt_autogenerated_project C CXX) | ||
add_executable(main) | ||
|
||
set(CRT_LIB_BASE crt/src/runtime/crt) | ||
set(CRT_LIBS microtvm_rpc_server | ||
microtvm_rpc_common | ||
aot_executor_module | ||
aot_executor | ||
graph_executor_module | ||
graph_executor | ||
common | ||
memory | ||
) | ||
|
||
# Build CRT libraries | ||
foreach(crt_lib_name ${CRT_LIBS}) | ||
add_library(${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}) | ||
target_include_directories(${crt_lib_name} PRIVATE crt_config crt/include) | ||
target_compile_definitions(${crt_lib_name} PRIVATE -DTVM_HOST_USE_GRAPH_EXECUTOR_MODULE) | ||
target_link_libraries(main PRIVATE ${crt_lib_name}) | ||
endforeach(crt_lib_name ${CRT_LIBS}) | ||
|
||
# Build model files | ||
add_library(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-error=unused-variable -Wno-error=missing-braces -Wno-error=unused-const-variable -Wno-unused-variable) | ||
set_target_properties(tvm_model PROPERTIES LINKER_LANGUAGE C) | ||
target_link_libraries(main PRIVATE tvm_model) | ||
|
||
file(GLOB_RECURSE app_srcs src/**.cc) | ||
target_sources(main PRIVATE ${app_srcs} ${cmsis_lib_srcs}) | ||
target_compile_definitions(main PRIVATE -DTVM_HOST_USE_GRAPH_EXECUTOR_MODULE) | ||
target_include_directories(main PRIVATE crt_config include ${CMAKE_SOURCE_DIR}/include crt/include) |
This file was deleted.
Oops, something went wrong.
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
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