2019-12-19 05:02:55 +08:00
|
|
|
# TODO: remove for release.
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "build type")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Require 3.3 and set policy CMP0057 for IN_LIST operator support
|
|
|
|
cmake_minimum_required(VERSION 3.3)
|
|
|
|
cmake_policy(SET CMP0057 NEW)
|
|
|
|
project(onnf)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
2019-11-19 08:37:58 +08:00
|
|
|
|
|
|
|
set(ONNF_SRC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
set(ONNF_BIN_ROOT "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
#TODO(eventually enable the following)
|
|
|
|
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
2019-12-19 05:02:55 +08:00
|
|
|
|
2019-12-20 03:24:37 +08:00
|
|
|
add_subdirectory(third_party/onnx)
|
|
|
|
add_subdirectory(third_party/benchmark)
|
|
|
|
add_subdirectory(third_party/pybind11)
|
|
|
|
|
2019-12-19 05:02:55 +08:00
|
|
|
# Set cxx standard only for onnf project files.
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
2019-12-20 03:24:37 +08:00
|
|
|
# Boost 1.61.0 required for boost::dll:program_location()
|
|
|
|
find_package(Boost 1.61.0
|
|
|
|
COMPONENTS graph
|
|
|
|
program_options
|
|
|
|
log_setup
|
|
|
|
log
|
|
|
|
system
|
|
|
|
filesystem
|
|
|
|
REQUIRED)
|
|
|
|
|
|
|
|
if(Boost_FOUND)
|
|
|
|
message("Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}")
|
|
|
|
message("Boost_LIBRARY_DIRS = ${Boost_LIBRARY_DIRS}")
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
endif()
|
|
|
|
|
2019-10-09 07:25:59 +08:00
|
|
|
include(MLIR.cmake)
|
2019-12-19 05:02:55 +08:00
|
|
|
add_subdirectory(src/builder)
|
2019-10-09 07:25:59 +08:00
|
|
|
add_subdirectory(src/compiler)
|
2019-12-20 03:24:37 +08:00
|
|
|
add_subdirectory(src)
|
2019-12-19 05:02:55 +08:00
|
|
|
|