Browse Source

Use FILE GLOB_RECURSE for AUX_SOURCE_DIRECTORY

tags/v1.5.1
zhangxiaokun 3 years ago
parent
commit
db53f82c78
2 changed files with 14 additions and 26 deletions
  1. +7
    -12
      tests/ut/common/graph/CMakeLists.txt
  2. +7
    -14
      tests/ut/ge/CMakeLists.txt

+ 7
- 12
tests/ut/common/graph/CMakeLists.txt View File

@@ -61,22 +61,17 @@ set(UT_FILES
"testcase/ge_graph/ge_model_unittest.cc"
)

AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph GRAPH_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/detail GRAPH_DETAIL_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/opsproto GRAPH_OPSPROTO_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/option GRAPH_OPTION_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/utils GRAPH_UTILS_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/utils/dumper GRAPH_DUMPER_SRC_FILES)
FILE(GLOB_RECURSE GRAPH_SRC_FILES_DEPTH0 ${GE_CODE_DIR}/metadef/graph/*.cc)
FILE(GLOB_RECURSE GRAPH_SRC_FILES_DEPTH1 ${GE_CODE_DIR}/metadef/graph/*/*.cc)
FILE(GLOB_RECURSE GRAPH_SRC_FILES_DEPTH2 ${GE_CODE_DIR}/metadef/graph/*/*/*.cc)

AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/ops GRAPH_OPS_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/third_party/transformer/src TRANSFORMER_SRC_FILES)

add_executable(ut_libgraph ${UT_FILES}
${GRAPH_SRC_FILES}
${GRAPH_UTILS_SRC_FILES}
${GRAPH_OPSPROTO_SRC_FILES}
${GRAPH_OPTION_SRC_FILES}
${GRAPH_DETAIL_SRC_FILES}
${GRAPH_DUMPER_SRC_FILES}
${GRAPH_SRC_FILES_DEPTH0}
${GRAPH_SRC_FILES_DEPTH1}
${GRAPH_SRC_FILES_DEPTH2}
${GRAPH_OPS_SRC_FILES}
${TRANSFORMER_SRC_FILES}
${PROTO_SRCS} ${PROTO_HDRS}


+ 7
- 14
tests/ut/ge/CMakeLists.txt View File

@@ -72,13 +72,10 @@ include_directories(${CMAKE_BINARY_DIR}/proto/ge/proto)


#### GRAPH_SRC_FILES ####
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph GRAPH_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/debug GRAPH_DEBUG_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/detail GRAPH_DETAIL_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/opsproto GRAPH_OPSPROTO_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/option GRAPH_OPTION_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/utils GRAPH_UTILS_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/graph/utils/dumper GRAPH_DUMPER_SRC_FILES)
FILE(GLOB_RECURSE GRAPH_SRC_FILES_DEPTH0 ${GE_CODE_DIR}/metadef/graph/*.cc)
FILE(GLOB_RECURSE GRAPH_SRC_FILES_DEPTH1 ${GE_CODE_DIR}/metadef/graph/*/*.cc)
FILE(GLOB_RECURSE GRAPH_SRC_FILES_DEPTH2 ${GE_CODE_DIR}/metadef/graph/*/*/*.cc)

AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/ops GRAPH_OPS_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/register GRAPH_REGISTER_SRC_FILES)
AUX_SOURCE_DIRECTORY(${GE_CODE_DIR}/metadef/third_party/transformer/src TRANSFORMER_SRC_FILES)
@@ -762,13 +759,9 @@ list(APPEND COMMON_SHARED_LIBRARIES

# build graph
add_library(ge_ut_graph STATIC
${GRAPH_SRC_FILES}
${GRAPH_DEBUG_SRC_FILES}
${GRAPH_DETAIL_SRC_FILES}
${GRAPH_OPSPROTO_SRC_FILES}
${GRAPH_OPTION_SRC_FILES}
${GRAPH_UTILS_SRC_FILES}
${GRAPH_DUMPER_SRC_FILES}
${GRAPH_SRC_FILES_DEPTH0}
${GRAPH_SRC_FILES_DEPTH1}
${GRAPH_SRC_FILES_DEPTH2}
${GRAPH_OPS_SRC_FILES}
${GRAPH_REGISTER_SRC_FILES}
${TRANSFORMER_SRC_FILES}


Loading…
Cancel
Save