make builds more robust (#906) (#932)

This commit is contained in:
Maik Riechert 2019-04-29 20:58:20 +01:00 committed by Pranav Sharma
parent 8d6114038f
commit ded7eeb033
11 changed files with 47 additions and 36 deletions

View file

@ -11,12 +11,12 @@ endif()
# Cpp Tests were added and they require googletest
# since we have our own copy, try using that
set(ONNX_SOURCE_ROOT ${PROJECT_SOURCE_DIR}/external/onnx)
file(GLOB_RECURSE onnx_src
file(GLOB_RECURSE onnx_src CONFIGURE_DEPENDS
"${ONNX_SOURCE_ROOT}/onnx/*.h"
"${ONNX_SOURCE_ROOT}/onnx/*.cc"
)
file(GLOB_RECURSE onnx_exclude_src
file(GLOB_RECURSE onnx_exclude_src CONFIGURE_DEPENDS
"${ONNX_SOURCE_ROOT}/onnx/py_utils.h"
"${ONNX_SOURCE_ROOT}/onnx/proto_utils.h"
"${ONNX_SOURCE_ROOT}/onnx/backend/test/cpp/*"

View file

@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file(GLOB_RECURSE onnxruntime_codegen_tvm_srcs
file(GLOB_RECURSE onnxruntime_codegen_tvm_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/codegen/tvm/*.h"
"${ONNXRUNTIME_ROOT}/core/codegen/tvm/*.cc"
)

View file

@ -32,7 +32,9 @@ else()
)
endif()
file(GLOB onnxruntime_common_src ${onnxruntime_common_src_patterns})
file(GLOB onnxruntime_common_src CONFIGURE_DEPENDS
${onnxruntime_common_src_patterns}
)
source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_common_src})

View file

@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file(GLOB_RECURSE onnxruntime_framework_srcs
file(GLOB_RECURSE onnxruntime_framework_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_INCLUDE_DIR}/core/framework/*.h"
"${ONNXRUNTIME_ROOT}/core/framework/*.h"
"${ONNXRUNTIME_ROOT}/core/framework/*.cc"

View file

@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file(GLOB_RECURSE onnxruntime_graph_src
file(GLOB_RECURSE onnxruntime_graph_src CONFIGURE_DEPENDS
"${ONNXRUNTIME_INCLUDE_DIR}/core/graph/*.h"
"${ONNXRUNTIME_ROOT}/core/graph/*.h"
"${ONNXRUNTIME_ROOT}/core/graph/*.cc"
@ -14,7 +14,7 @@ if (onnxruntime_DISABLE_CONTRIB_OPS)
)
endif()
file(GLOB_RECURSE onnxruntime_ir_defs_src
file(GLOB_RECURSE onnxruntime_ir_defs_src CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/defs/*.cc"
)

View file

@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file(GLOB onnxruntime_optimizer_srcs
file(GLOB onnxruntime_optimizer_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/optimizer/*.h"
"${ONNXRUNTIME_ROOT}/core/optimizer/*.cc"
)

View file

@ -1,19 +1,19 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file(GLOB_RECURSE onnxruntime_providers_srcs
file(GLOB_RECURSE onnxruntime_providers_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/cpu/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/cpu/*.cc"
)
file(GLOB_RECURSE onnxruntime_contrib_ops_srcs
file(GLOB_RECURSE onnxruntime_contrib_ops_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/contrib_ops/*.h"
"${ONNXRUNTIME_ROOT}/contrib_ops/*.cc"
"${ONNXRUNTIME_ROOT}/contrib_ops/cpu/*.h"
"${ONNXRUNTIME_ROOT}/contrib_ops/cpu/*.cc"
)
file(GLOB onnxruntime_providers_common_srcs
file(GLOB onnxruntime_providers_common_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/*.cc"
)
@ -55,11 +55,11 @@ set_target_properties(onnxruntime_providers PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(onnxruntime_providers PROPERTIES FOLDER "ONNXRuntime")
if (onnxruntime_USE_CUDA)
file(GLOB_RECURSE onnxruntime_providers_cuda_cc_srcs
file(GLOB_RECURSE onnxruntime_providers_cuda_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/cuda/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/cuda/*.cc"
)
file(GLOB_RECURSE onnxruntime_providers_cuda_cu_srcs
file(GLOB_RECURSE onnxruntime_providers_cuda_cu_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/cuda/*.cu"
"${ONNXRUNTIME_ROOT}/core/providers/cuda/*.cuh"
)
@ -95,7 +95,7 @@ if (onnxruntime_USE_CUDA)
endif()
if (onnxruntime_USE_MKLDNN)
file(GLOB_RECURSE onnxruntime_providers_mkldnn_cc_srcs
file(GLOB_RECURSE onnxruntime_providers_mkldnn_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/mkldnn/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/mkldnn/*.cc"
)
@ -159,7 +159,7 @@ if (onnxruntime_USE_TENSORRT)
set(trt_link_libs cudnn ${CMAKE_DL_LIBS} ${TENSORRT_LIBRARY})
set(onnxparser_link_libs nvonnxparser_static nvonnxparser_plugin)
file(GLOB_RECURSE onnxruntime_providers_tensorrt_cc_srcs
file(GLOB_RECURSE onnxruntime_providers_tensorrt_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/tensorrt/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/tensorrt/*.cc"
)
@ -182,7 +182,7 @@ endif()
if (onnxruntime_USE_NGRAPH)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/onnx")
file(GLOB_RECURSE onnxruntime_providers_ngraph_cc_srcs
file(GLOB_RECURSE onnxruntime_providers_ngraph_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/ngraph/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/ngraph/*.cc"
)

View file

@ -36,7 +36,9 @@ set(onnxruntime_pybind_srcs_pattern
"${ONNXRUNTIME_ROOT}/python/*.h"
)
file(GLOB onnxruntime_pybind_srcs ${onnxruntime_pybind_srcs_pattern})
file(GLOB onnxruntime_pybind_srcs CONFIGURE_DEPENDS
${onnxruntime_pybind_srcs_pattern}
)
#TODO(): enable cuda and test it
add_library(onnxruntime_pybind11_state MODULE ${onnxruntime_pybind_srcs})
@ -114,22 +116,22 @@ else()
set_target_properties(onnxruntime_pybind11_state PROPERTIES SUFFIX ".so")
endif()
file(GLOB onnxruntime_backend_srcs
file(GLOB onnxruntime_backend_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/python/backend/*.py"
)
file(GLOB onnxruntime_python_srcs
file(GLOB onnxruntime_python_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/python/*.py"
)
file(GLOB onnxruntime_python_test_srcs
file(GLOB onnxruntime_python_test_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/test/python/*.py"
)
file(GLOB onnxruntime_python_tools_srcs
file(GLOB onnxruntime_python_tools_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/python/tools/*.py"
)
file(GLOB onnxruntime_python_datasets_srcs
file(GLOB onnxruntime_python_datasets_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/python/datasets/*.py"
)
file(GLOB onnxruntime_python_datasets_data
file(GLOB onnxruntime_python_datasets_data CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/python/datasets/*.pb"
"${ONNXRUNTIME_ROOT}/python/datasets/*.onnx"
)

View file

@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file(GLOB onnxruntime_session_srcs
file(GLOB onnxruntime_session_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_INCLUDE_DIR}/core/session/*.h"
"${ONNXRUNTIME_ROOT}/core/session/*.h"
"${ONNXRUNTIME_ROOT}/core/session/*.cc"

View file

@ -68,24 +68,24 @@ endfunction(AddTest)
#Use onnxruntime_add_include_to_target or target_link_libraries, so that compile definitions
#can propagate correctly.
file(GLOB onnxruntime_test_utils_src
file(GLOB onnxruntime_test_utils_src CONFIGURE_DEPENDS
"${TEST_SRC_DIR}/util/include/*.h"
"${TEST_SRC_DIR}/util/*.cc"
)
file(GLOB onnxruntime_test_common_src
file(GLOB onnxruntime_test_common_src CONFIGURE_DEPENDS
"${TEST_SRC_DIR}/common/*.cc"
"${TEST_SRC_DIR}/common/*.h"
"${TEST_SRC_DIR}/common/logging/*.cc"
"${TEST_SRC_DIR}/common/logging/*.h"
)
file(GLOB onnxruntime_test_ir_src
file(GLOB onnxruntime_test_ir_src CONFIGURE_DEPENDS
"${TEST_SRC_DIR}/ir/*.cc"
"${TEST_SRC_DIR}/ir/*.h"
)
file(GLOB onnxruntime_test_optimizer_src
file(GLOB onnxruntime_test_optimizer_src CONFIGURE_DEPENDS
"${TEST_SRC_DIR}/optimizer/*.cc"
"${TEST_SRC_DIR}/optimizer/*.h"
)
@ -118,14 +118,15 @@ if(NOT onnxruntime_DISABLE_CONTRIB_OPS)
"${TEST_SRC_DIR}/contrib_ops/*.cc")
endif()
file(GLOB onnxruntime_test_providers_src ${onnxruntime_test_providers_src_patterns})
file(GLOB_RECURSE onnxruntime_test_providers_cpu_src
file(GLOB onnxruntime_test_providers_src CONFIGURE_DEPENDS
${onnxruntime_test_providers_src_patterns})
file(GLOB_RECURSE onnxruntime_test_providers_cpu_src CONFIGURE_DEPENDS
"${TEST_SRC_DIR}/providers/cpu/*"
)
list(APPEND onnxruntime_test_providers_src ${onnxruntime_test_providers_cpu_src})
if (onnxruntime_USE_NGRAPH)
file(GLOB_RECURSE onnxruntime_test_providers_ngraph_src
file(GLOB_RECURSE onnxruntime_test_providers_ngraph_src CONFIGURE_DEPENDS
"${TEST_SRC_DIR}/providers/ngraph/*"
)
list(APPEND onnxruntime_test_providers_src ${onnxruntime_test_providers_ngraph_src})
@ -183,7 +184,7 @@ if(onnxruntime_USE_NGRAPH)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_ngraph)
endif()
file(GLOB_RECURSE onnxruntime_test_tvm_src
file(GLOB_RECURSE onnxruntime_test_tvm_src CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/test/tvm/*.h"
"${ONNXRUNTIME_ROOT}/test/tvm/*.cc"
)
@ -228,7 +229,9 @@ if(WIN32)
endif()
endif()
file(GLOB onnxruntime_test_framework_src ${onnxruntime_test_framework_src_patterns})
file(GLOB onnxruntime_test_framework_src CONFIGURE_DEPENDS
${onnxruntime_test_framework_src_patterns}
)
#with auto initialize onnxruntime
add_library(onnxruntime_test_utils_for_framework ${onnxruntime_test_utils_src})
@ -261,7 +264,9 @@ if (SingleUnitTestProject)
endif()
# we can only have one 'main', so remove them all and add back the providers test_main as it sets
# up everything we need for all tests
file(GLOB_RECURSE test_mains "${TEST_SRC_DIR}/*/test_main.cc")
file(GLOB_RECURSE test_mains CONFIGURE_DEPENDS
"${TEST_SRC_DIR}/*/test_main.cc"
)
list(REMOVE_ITEM all_tests ${test_mains})
list(APPEND all_tests "${TEST_SRC_DIR}/providers/test_main.cc")
@ -474,7 +479,9 @@ else ()
"${onnxruntime_perf_test_src_dir}/posix/*.h" )
endif()
file(GLOB onnxruntime_perf_test_src ${onnxruntime_perf_test_src_patterns})
file(GLOB onnxruntime_perf_test_src CONFIGURE_DEPENDS
${onnxruntime_perf_test_src_patterns}
)
add_executable(onnxruntime_perf_test ${onnxruntime_perf_test_src} ${ONNXRUNTIME_ROOT}/core/framework/path_lib.cc)
target_include_directories(onnxruntime_perf_test PRIVATE ${onnx_test_runner_src_dir} ${ONNXRUNTIME_ROOT}

View file

@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file(GLOB_RECURSE onnxruntime_util_srcs
file(GLOB_RECURSE onnxruntime_util_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/util/*.h"
"${ONNXRUNTIME_ROOT}/core/util/*.cc"
)