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)
|
2020-03-17 21:16:33 +08:00
|
|
|
project(onnx-mlir)
|
2019-12-19 05:02:55 +08:00
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
|
2019-11-19 08:37:58 +08:00
|
|
|
|
2020-03-17 21:16:33 +08:00
|
|
|
set(ONNX_MLIR_SRC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
set(ONNX_MLIR_BIN_ROOT "${CMAKE_CURRENT_BINARY_DIR}")
|
2020-04-19 22:11:24 +08:00
|
|
|
|
2019-11-19 08:37:58 +08:00
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
2019-12-23 09:33:33 +08:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
2019-12-19 05:02:55 +08:00
|
|
|
|
2020-06-08 10:18:55 +08:00
|
|
|
include(CTest)
|
2019-11-28 11:56:34 +08:00
|
|
|
include(MLIR.cmake)
|
|
|
|
|
2020-04-19 22:11:24 +08:00
|
|
|
if (MSVC)
|
|
|
|
# Disable warnings that prevent building of dependencies
|
|
|
|
# like onnx
|
2020-09-25 21:58:03 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "-wd4244 -wd4267 -wd4530 -wd4624 /bigobj")
|
2020-04-19 22:11:24 +08:00
|
|
|
endif()
|
2019-12-20 03:24:37 +08:00
|
|
|
add_subdirectory(third_party/onnx)
|
2020-08-18 20:41:19 +08:00
|
|
|
add_subdirectory(third_party/googletest)
|
2019-12-20 03:24:37 +08:00
|
|
|
add_subdirectory(third_party/benchmark)
|
|
|
|
add_subdirectory(third_party/pybind11)
|
2020-01-22 10:36:21 +08:00
|
|
|
add_subdirectory(third_party/variant)
|
2020-06-08 10:18:55 +08:00
|
|
|
add_subdirectory(third_party/rapidcheck)
|
2019-12-20 03:24:37 +08:00
|
|
|
|
2019-12-19 05:02:55 +08:00
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
2020-05-13 06:43:44 +08:00
|
|
|
|
2020-04-08 15:00:34 +08:00
|
|
|
add_subdirectory(utils)
|
2019-12-20 03:24:37 +08:00
|
|
|
add_subdirectory(src)
|
2020-04-09 23:37:04 +08:00
|
|
|
add_subdirectory(docs)
|
2020-05-13 06:43:44 +08:00
|
|
|
add_subdirectory(test)
|