Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onert-micro] Add main Cmake file #12630

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions onert-micro/onert-micro/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
set(OM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(OM_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(OM_PAL_COMMON_DIR "${OM_INCLUDE_DIR}/pal/common")
# if no path is specified, use classic to mcu
if (NOT OM_PAL_DIR)
set(OM_PAL_DIR "${OM_INCLUDE_DIR}/pal/mcu")
endif()

# if no path is specified, use classic to KernelsToBuild list, else use generated one
if (NOT OM_KERNELS_BUILD_LIST)
set(KERNEL_REGISTER_FILE "${OM_PAL_DIR}/KernelsToBuild.lst")
else()
set(KERNEL_REGISTER_FILE ${OM_KERNELS_BUILD_LIST})
endif()

set(PASS_REGISTER_FILE "${OM_INCLUDE_DIR}/optimize/BuildPass.lst")
set(CUSTOM_KERNEL_REGISTER_FILE "${OM_PAL_DIR}/CustomKernelsToBuild.lst")

# To build onert-micro for eval-driver x86-64 version (to avoid name conflicts)
if (NOT DEFINED CUSTOM_OM_SUFFIX)
set(OM_SUFFIX "")
else()
set(OM_SUFFIX ${CUSTOM_OM_SUFFIX})
endif()

# To disable quantize kernels
if (DIS_QUANT)
add_definitions(-DDIS_QUANT)
endif()

# To disable float kernels
if (DIS_FLOAT)
add_definitions(-DDIS_FLOAT)
endif()

# To enable training part
if (ENABLE_TRAINING)
add_definitions(-DENABLE_TRAINING)
endif()

# TODO move it to specific cmake for platforms
add_compile_options(-fno-exceptions)
add_compile_options(-Os)

# AFAIK, this will enable leak sanitizer, too
if(ENABLE_SANITIZER)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif(ENABLE_SANITIZER)

add_subdirectory(src)
Loading